Repository navigation
fix: start timed unblocks at iOS's activity limit and show unblock errors - #113
Merged
Merged
Conversation
ykisana
force-pushed
the
fix/show-default-unblock-errors
branch
from
November 15, 2026 23:20
31b411e to
c862dd9
Compare
…rors At iOS's 20 schedules-and-timers limit, a timed unblock now starts without its own timer and the monitor re-blocks it at the next :00/:30 heartbeat. The app says it may end up to 30 minutes late. This only applies when the heartbeat is registered; without it (a phone that filled every slot before 1.6) nothing would re-block the unblock, so it still fails. Other failures to start an unblock with the default duration now show "Couldn't Unblock" instead of failing silently.
ykisana
force-pushed
the
fix/show-default-unblock-errors
branch
from
November 16, 2026 12:58
c862dd9 to
0c76e4a
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
When iOS refuses to register a timed unblock's timer, the unblock fails:
catch {}/try?). The key check passes and apps stay blocked.The usual cause is
excessiveActivities: iOS only allows 20 schedules and timers per app. Schedules can't be turned off while anything is blocked, so there was nothing the user could do.Fix
TimedUnblockServicereturnsUnblockTiming.mayEndLateinstead of throwing. The unblock is saved without its own timer, and the monitor re-blocks it at the next :00 or :30 heartbeat. The heartbeat is registered before schedules, so it's never the one refused. While Normal is open, its in-app timer re-blocks on time.unauthorized) show "Couldn't Unblock" with the error's description, instead of failing silently.unblockAlertmodifier (View+UnblockAlert.swift). The group card's alert is hosted onGroupsView, the same as its duration sheet.Test-only launch arguments:
-uiTestTimerLimitReached: the UI-test activity center throwsexcessiveActivitiesfor timed-unblock activities.-uiTestTimedUnblockFails: same, withunauthorized.-uiTestSlowScan: the QR stub waits 1 s, like a real scan. With the instant stub, a cold link launch finished the scan while the key sheet was still presenting, and the alert was dropped.Tests
Unit:
startMainreturns.mayEndLate, saves the unblock and registers no timer for it.startMainthrows and saves nothing. With 20 schedules carried over and no heartbeat, Unblock All throws and apps stay blocked.unauthorized.UI:
testDefaultDurationUnblockAtTheTimerLimitSaysItMayEndLateandtestDurationSheetUnblockAtTheTimerLimitSaysItMayEndLate. They seed a schedule so the heartbeat is registered, as on a phone at the limit.testFailedDefaultDurationUnblockShowsError,testFailedDefaultDurationGroupUnblockShowsErrorandtestFailedUnlockLinkShowsError. Before the fix all three failed ("should say so").Results:
Caveat: on a locked phone, heartbeat callbacks have been measured up to ~15 minutes late, so "up to 30 minutes" can stretch further.
Note: on the iOS 27 simulator,
XCUIApplication.open(URL)force-quits and relaunches the app, so link UI tests start from fresh in-memory state. The existing link tests are affected too; that's left for a separate change.