-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Fix iOS push alerts opt-out toggle #10112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
121 commits
Select commit
Hold shift + click to select a range
b4625c4
test(ios): cover pending push opt-out
azooz2003-bit e7c9a6a
fix(ios): update push toggle optimistically
azooz2003-bit d2d527a
test(ios): make push toggle timing assertion deterministic
azooz2003-bit 952586e
fix(ios): restore toast settings binding
azooz2003-bit 207491f
fix(ios): remove retired toast settings toggle
azooz2003-bit 63ed21a
fix(ios): initialize task composer setting
azooz2003-bit 12cf0c5
fix(ios): tie push toggle mutation to view lifecycle
azooz2003-bit 653a43d
fix(ios): bound push toggle mutations
azooz2003-bit a162e51
refactor(ios): isolate push preview mutation gate
azooz2003-bit 6b69895
fix(ios): surface uncertain push toggle outcomes
azooz2003-bit 7f4f7d3
Merge remote-tracking branch 'origin/main' into fix-ios-push-toggle-off
azooz2003-bit 5f4c064
fix(ios): bound push readiness reconciliation
azooz2003-bit 4492cf1
fix(ios): serialize timed out push mutations
azooz2003-bit 57bef7d
fix(ios): serialize push retries after reconciliation
azooz2003-bit e679e16
fix(ios): own push preference mutation in coordinator
azooz2003-bit 5bc3c10
fix(ios): preempt stale push registration work
azooz2003-bit 09868c8
test(push): require serialized opt-out mutation
azooz2003-bit 4a5301d
test(push): cover ordered opt-out intents
azooz2003-bit 90a97c1
fix(push): serialize notification intent mutations
azooz2003-bit 8bde795
test(push): cover latest intent ordering
azooz2003-bit 6300751
fix(push): make latest notification intent authoritative
azooz2003-bit 9f86b86
test(push): deduplicate same-generation activation
azooz2003-bit 4379d55
fix(push): coalesce repeated registration intents
azooz2003-bit d86f774
fix(push): coalesce pending notification intents
azooz2003-bit 88b75b0
test(push): recover disabled startup cleanup
azooz2003-bit ebcdf1c
fix(push): recover interrupted opt-out cleanup
azooz2003-bit 0b2802b
test(push): persist opt-out before cleanup
azooz2003-bit 9177de8
fix(push): atomically commit coordinator intent
azooz2003-bit 87da95b
refactor(push): align service package conventions
azooz2003-bit 7c7f86f
test(push): cover startup ownership and stale snapshots
azooz2003-bit 0e9a3fa
fix(push): fence in-flight cleanup and stale snapshots
azooz2003-bit d5818e9
test(push): cover reenable generation during cleanup
azooz2003-bit cdffcba
fix(push): submit every current enable generation
azooz2003-bit 15270dc
test(push): preserve enable after caller cancellation
azooz2003-bit 5f2c42b
fix(push): let intent drains outlive caller cancellation
azooz2003-bit 66b9763
test(push): preserve absent preference on startup
azooz2003-bit 9c94426
fix(push): require explicit opt-out for startup cleanup
azooz2003-bit f5c9664
test(push): preserve denied reenable generation
azooz2003-bit 6bdd586
fix(push): propagate denied enable generation
azooz2003-bit b93b7e0
fix(push): unify preference mutation ordering
azooz2003-bit e8a3df1
chore(push): isolate intent kind type
azooz2003-bit 845883c
test(push): cancel queued mutation waiter
azooz2003-bit 886a28c
fix(push): drop cancelled mutation waiters
azooz2003-bit 18c5584
test(push): accept initial coordinator generation
azooz2003-bit abe6ac9
fix(push): accept generation zero startup intent
azooz2003-bit be49424
fix(push): recheck cancellation at gate handoff
azooz2003-bit bf861ab
test(push): recover cancelled queued registration
azooz2003-bit a9d3eec
fix(push): recover cancelled registration attempts
azooz2003-bit c2c06d7
test(push): fix cancellation regression setup
azooz2003-bit 59ded95
test(push): bound stalled settings mutation
azooz2003-bit cb19142
fix(push): bound settings mutation lifetime
azooz2003-bit 8631125
chore(push): isolate timeout outcome type
azooz2003-bit fa2d641
test(push): retry timed out enable intent
azooz2003-bit 15f23dd
fix(push): permit retry after settings timeout
azooz2003-bit 81f03ee
test(push): cover late prompt and worker cancellation
azooz2003-bit 72d7ee6
fix(push): reconcile late authorization and cancel workers
azooz2003-bit 7c6ef3c
test(push): isolate mutation timeout generations
azooz2003-bit f1582d5
test(push): preserve queued sign-out cleanup on cancellation
azooz2003-bit 84bd0cc
fix(push): persist sign-out cleanup before mutation gate
azooz2003-bit 62a72a7
test(push): cover stale registration and public enable timeout
azooz2003-bit 197fb04
fix(push): fence direct registration commits and bound enables
azooz2003-bit 015f353
test(push): fence opt-out cleanup to persisted owner
azooz2003-bit a441e85
fix(push): require persisted owner for opt-out cleanup
azooz2003-bit eb29f93
test(push): seed cleanup owner in queued sign-out
azooz2003-bit 8546b3d
fix(push): reject unproven legacy cleanup credentials
azooz2003-bit 75937e4
fix(push): store boolean settings mutation task
azooz2003-bit 87c0033
test(push): cover stalled intent and timeout worker ownership
azooz2003-bit 25ba6fd
fix(push): retain bounded mutation lanes until completion
azooz2003-bit 1130e64
refactor(push): keep intent lane state flat
azooz2003-bit f3b831f
test(push): require timed-out intent to reach service
azooz2003-bit faa340e
fix(push): commit intents before bounded reconciliation
azooz2003-bit 1f9c96d
test(push): require bounded timeout recovery
azooz2003-bit 6e98cee
fix(push): bound timeout recovery lanes
azooz2003-bit 0cfa6da
test(push): cover late intent and timeout winner races
azooz2003-bit 6832304
fix(push): fence late intents and timeout races
azooz2003-bit 5528198
test(push): cover startup drain and same-lane recovery
azooz2003-bit 01fdd8e
fix(push): bound same-lane recovery and startup cleanup
azooz2003-bit 6019041
test(push): wait for same-lane recovery state
azooz2003-bit 61b1afc
test(push): require fresh bounded recovery after timeout
azooz2003-bit 9b0f659
fix(push): bound cached registration recovery
azooz2003-bit 890b6b9
refactor(push): isolate intent worker type
azooz2003-bit 86c89f5
test(push): protect newer registration from stale sign-out
azooz2003-bit e599af9
fix(push): order sign-out with newer registration
azooz2003-bit c33317a
refactor(push): use one reconciliation worker
azooz2003-bit d7ebaae
test(ios): recover timed-out push opt-out
azooz2003-bit 8a8fb0b
fix(ios): recover timed-out push cleanup
azooz2003-bit 8a982c1
Merge remote-tracking branch 'origin/main' into fix-ios-push-toggle-off
azooz2003-bit c9cc7c1
refactor(ios): reduce push toggle fix scope
azooz2003-bit 4666aa7
test(ios): cover pending push opt-out
azooz2003-bit ed6e5e0
fix(ios): update push toggle optimistically
azooz2003-bit dc37932
test(ios): signal pending push mutation
azooz2003-bit 253e670
fix(ios): keep push toggle interactive
azooz2003-bit 2f0e084
test(ios): bound pending push fixture
azooz2003-bit 1834813
test(ios): isolate push fixture state
azooz2003-bit 71818d7
fix(ios): serialize push toggle mutations
azooz2003-bit e6d722d
fix(ios): preserve queued push intent
azooz2003-bit 38ffb32
fix(ios): honor resolved push state
azooz2003-bit 9aae5b3
test(ios): cover superseded push intent
azooz2003-bit c9be524
fix(ios): supersede stale push intents
azooz2003-bit 3607cc8
fix(ios): reconcile started push mutations
azooz2003-bit 1fa4230
refactor(push): own intent reconciliation
azooz2003-bit 9800bdd
test(push): require immediate opt-out cleanup
azooz2003-bit d34c247
fix(push): let opt-outs bypass stale work
azooz2003-bit d9a4ea5
fix(push): authorize before backend reconciliation
azooz2003-bit c32c631
test(push): bound pending cleanup storage
azooz2003-bit 4364c2d
fix(push): bound pending cleanup state
azooz2003-bit 708bc6b
fix(push): preserve overflow cleanup obligations
azooz2003-bit 48730ca
Merge origin/main into fix-ios-push-toggle-off
azooz2003-bit 3f6a681
fix(push): page durable cleanup overflow
azooz2003-bit 0c443b5
fix(push): discard stale cleanup index entries
azooz2003-bit 3a25ecf
fix(push): continue paged cleanup drains
azooz2003-bit d3841ca
fix(push): supersede direct cleanup retries
azooz2003-bit 8dc9926
fix(push): preserve cleanup intent across retries
azooz2003-bit 5146847
fix(push): preserve generation through cleanup recovery
azooz2003-bit d212b57
fix(push): index durable cleanup obligations
azooz2003-bit d1ef41b
fix(push): make cleanup migration transactional
azooz2003-bit b4ff551
fix(push): close notification intent races
azooz2003-bit 8fa5021
fix(push): bound recovery workers
azooz2003-bit 869b992
fix(push): preserve ambiguous cleanup state
azooz2003-bit 8677b43
fix(push): await bounded opt-out cleanup
azooz2003-bit 52e1b9c
Merge remote-tracking branch 'origin/main' into fix-ios-push-toggle-off
azooz2003-bit File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
Packages/iOS/CmuxMobileShellUI/Sources/CmuxMobileShellUI/MobilePushToggle.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| #if os(iOS) | ||
| import CmuxMobileSupport | ||
| import SwiftUI | ||
|
|
||
| /// The phone push preference is persisted asynchronously, so update the | ||
| /// control optimistically and roll it back only when the mutation fails. | ||
| /// Keeping this binding shared prevents release and diagnostic settings from | ||
| /// drifting into different interaction behavior. | ||
| struct MobilePushToggle: View { | ||
| @Binding var isEnabled: Bool | ||
| @Binding var isUpdating: Bool | ||
| let onChange: @MainActor (Bool) async -> Bool | ||
|
|
||
| var body: some View { | ||
| Toggle( | ||
| L10n.string( | ||
| "mobile.notifications.phoneEnabled", | ||
| defaultValue: "Allow Push Alerts on This iPhone" | ||
| ), | ||
| isOn: binding | ||
| ) | ||
| .accessibilityIdentifier("MobileSettingsNotifications") | ||
| .disabled(isUpdating) | ||
| } | ||
|
|
||
| private var binding: Binding<Bool> { | ||
| Binding( | ||
| get: { isEnabled }, | ||
| set: { requested in | ||
| guard !isUpdating else { return } | ||
| let previous = isEnabled | ||
| isEnabled = requested | ||
| isUpdating = true | ||
| Task { @MainActor in | ||
| defer { isUpdating = false } | ||
| if !(await onChange(requested)) { | ||
| isEnabled = previous | ||
| } | ||
| } | ||
| } | ||
| ) | ||
| } | ||
| } | ||
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.