From 860eedb6de61350663abda532b1ccb45ae4f5a2c Mon Sep 17 00:00:00 2001 From: glennmichael123 Date: Fri, 4 Sep 2026 02:33:06 +0800 Subject: [PATCH] docs(ios): retire three refusal notes that outlived their refusals MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `scheduleNotification` sat with the Swift shim for days after the thing blocking it was fixed, because the note describing the blocker was still there and nobody re-read it. Sweeping for the same shape found three more. **`bridge_mobile_permissions.zig`** contradicted itself twice over `openSettings`. Its module header already said the action "**is** claimed now", while the doc comment three lines above the `A` block still called it "deliberately absent" and warned against adding it — and `A` has declared it since bdfa2ae. The header also said the ratchet "keeps counting `openSettings` as not-yet-migrated", which stopped being true the moment it was declared; what the ratchet actually still counts is the payload values `requestPermission` leaves to the shim — location, photos, contacts, calendar, reminders — so the sentence now names those. **`bridge_mobile_display.zig`** said badge authorization "is not attempted here". It is attempted now: `requestBadgeAuthorization` asks before the badge is written. That note was mine, left behind in the commit that added the ask. None of this changes behaviour. It is worth a commit because the cost of these is measurable rather than theoretical: a note that describes a limitation the code no longer has reads exactly like a note that describes a current one, and the only way to tell is to re-derive the whole argument. `bgtasks`' `registerBackgroundTask` note was checked in the same sweep and is still accurate — `BGTaskScheduler.register` must run before launch finishes, so a page-triggered call is late by construction and raises an uncatchable exception. That one stays. --- packages/zig/src/bridge_mobile_display.zig | 7 ++++--- packages/zig/src/bridge_mobile_permissions.zig | 16 ++++++++++------ 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/packages/zig/src/bridge_mobile_display.zig b/packages/zig/src/bridge_mobile_display.zig index 3c9c86de..8210552f 100644 --- a/packages/zig/src/bridge_mobile_display.zig +++ b/packages/zig/src/bridge_mobile_display.zig @@ -600,9 +600,10 @@ fn applyBadge(count: i64) !i64 { /// what happened rather than swallowing it. /// /// The completion handler is `nullable` in the header, so nil is legal and no -/// block is needed. Note that `requestAuthorizationWithOptions:`, which Swift -/// also calls, is *not* nullable there — passing nil to that one crashes, which -/// is part of why authorization is not attempted here. +/// block is needed. `requestAuthorizationWithOptions:`, which the spec also +/// calls, is *not* nullable there — passing nil to that one crashes, which is +/// why it needs a real block. It has one now: `requestBadgeAuthorization` +/// above asks before this writes, so this function no longer runs unasked. fn setBadgeThroughNotificationCenter(count: c_long) bool { const UNCenterClass = objc.objc_getClass("UNUserNotificationCenter") orelse return false; const sel_current = objc.sel_registerName("currentNotificationCenter") orelse return false; diff --git a/packages/zig/src/bridge_mobile_permissions.zig b/packages/zig/src/bridge_mobile_permissions.zig index 7c7cfebe..ad79e557 100644 --- a/packages/zig/src/bridge_mobile_permissions.zig +++ b/packages/zig/src/bridge_mobile_permissions.zig @@ -65,8 +65,10 @@ //! those took actions *away* from the shim because the shim's answers were //! fabricated or broken; these shim answers are real, and taking them away //! would trade working behaviour for a tidier table. The cost is that the -//! conformance ratchet keeps counting `openSettings` as not-yet-migrated — -//! which is the truth. +//! conformance ratchet keeps counting the payload values above — location, +//! photos, contacts, calendar, reminders — against `requestPermission`, which +//! is the truth. It no longer applies to `openSettings`: that one is claimed, +//! and the ratchet counts it as migrated. //! //! ## What is carried across exactly //! @@ -123,10 +125,12 @@ const Id = ?*anyopaque; /// The action names, spelled exactly as the Swift `case` labels spell them. /// -/// `openSettings` is deliberately absent — see the module comment. Adding it -/// here without first giving `ios_async` a boolean-literal reply would ship -/// the truthy-`"denied"` bug, and the conformance scan would count the action -/// as migrated while the shim was still the only honest server of it. +/// All three are claimed. `openSettings` was not, and this comment said so +/// long after it stopped being true — the module comment above records both +/// the original objection and why a module-owned global block answered it. +/// A doc comment that contradicts the `A` block three lines below it is worse +/// than none: `scheduleNotification` sat with the shim for days after its +/// blocker was fixed because nobody re-read the note that described it. pub const A = struct { pub const check_permission = "checkPermission"; pub const request_permission = "requestPermission";