Repository navigation
fix(apple): push edge cases from review - #2024
Conversation
With the app live but its banner not posted yet, as for a data-only message, the extension fetched with the same session and took the app's connection over. It now waits up to a heartbeat for the app's banner or its next heartbeat, either of which means the app is running and has the message, and fetches only when neither comes, as after a kill. The running app clears the placeholders it has the messages for on each heartbeat.
A placeholder was cleared only once every topic it was for was subscribed again, so one for a topic a later launch dropped, or whose filter changed, stayed. The launch's reconcile now clears those too.
…ound subscription A token change registered every Push that had ever subscribed in the background, re-creating a target that had been deleted for having none.
Without AppwritePushAppGroup the extension has no session and leaves the placeholder, silently. A background subscription without it now warns once, and so does the extension.
🟢 Tier S · Ready to merge
The Apple push templates coordinate notification-extension fetching with app heartbeats, diagnose missing App Group or session setup, and reconcile stale placeholders and targets as background subscriptions change. They also avoid registering APNs targets for Push instances without background subscriptions. The Apple and Swift HTTP clients now explicitly request gzip for decompression-enabled requests while preserving any caller-supplied Latest changes: The newest commits add an explicit gzip
📂 Walkthrough · 5
Reviewed the commits since |
…d subscription The reconcile cleared placeholders only after finding a Push with background topics, so a launch that dropped them all kept every marked placeholder. It now clears them before deciding, with nothing claimed.
With no Accept-Encoding of its own, NIO's decompressor asks for "deflate, gzip". Appwrite answers deflate with a raw deflate stream, not the zlib stream HTTP's deflate names, so every compressed response failed with DecompressionError.inflationError(-3). The Swift and Apple clients now ask for gzip unless the app sets Accept-Encoding.
fix(swift): ask for gzip so compressed responses decode
5700d17
into
feat/apple-push-apns
What does this PR do?
Fixes edge cases found in a review of #2000's push code. Stacked on #2000.
close(), thendeleteSessionbefore the target DELETEDELETE /account/sessions/:idqueuesDELETE_TYPE_SESSION_TARGETS, and the server deletes the session's targets and their subscribers. The SDK's own DELETE is then redundant (401, ignored).AppwritePushAppGroupmissing or signed outembedded.mobileprovisionand must be production. Only a profile that exists but can't be parsed hits the default.close()had deleted.messageIdIt also includes #2025 (merged in): the Swift and Apple clients now send
Accept-Encoding: gzip. NIO asked fordeflate, gzip, and Appwrite answersdeflatewith raw deflate rather than zlib, so every compressed response failed withDecompressionError.inflationError(-3). That was one of the errors that stopped APNs registration in the device test on #2000. Against a local Appwrite: 60 of 60account.get()calls failed before the change, and none after.The PR also puts
Deliveries' doc comment back onDeliveries; #2022 had left it aboveLinkedTopics.Test Plan
swift format lint --strict; macOS, iOS Simulator and Linux (swift:6.1-jammy, from the e2e fixture) builds; Generation suite and Twig lint.tools/runbook.phpin the test app.Related PRs and Issues