Skip to content

Show one unsafe notification permissions alert at a time - #2703

Open
ps2 wants to merge 1 commit into
next-devfrom
single-unsafe-permissions-alert
Open

ps2 wants to merge 1 commit into
next-devfrom
single-unsafe-permissions-alert

Conversation

@ps2

@ps2 ps2 commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator

The "Turn On Alarms" (unsafe notification permissions) alert could stack several copies at launch.

It is presented from two places: the permissions check, and launch playback of its unacknowledged AlertStore record. Playback normally runs first and the check then sees the alert as already issued. On a slow launch, such as one running a Core Data migration, playback runs after the check has issued and recorded the alert, so it presents a second copy. The controller was only remembered after presentation finished, so nothing stopped it.

This stores the controller before presenting, skips presenting while one exists, and clears it when the user taps Close or Settings so the alert can be shown again later.

Testing, simulator, alarms not authorized:

  • With playback delayed by 1 s (a temporary diagnostic patch, not included), relaunch after Close: 2 sheets before, 1 after. The replay hits the new guard.
  • Normal relaunch: 1 sheet.
  • Kill with the sheet up, then relaunch: playback shows 1 sheet.

Not exercised: a permission change while the app is running (re-show after Close in the same process, or retraction after granting alarms). Both paths clear the stored controller.

The alert is presented both when permissions are checked and when launch
playback replays an unacknowledged record. When playback ran after the
check (a slow launch, e.g. a Core Data migration), both presented, and the
controller was only remembered after presentation finished, so nothing
stopped the second copy. Remember the controller before presenting, skip
presenting while one exists, and forget it when the user closes it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant