Withdraw a chat's push notices by thread (collapse-id ready) #1
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/push-notification-withdraw"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Push notices for a chat are now withdrawn by their thread, not by their identifier. This goes with the server-side push changes: anotherim-server
feat/push-throttleand apushdfeat/push-coalesce.The bug. When a chat's read point moved,
ChatNotificationWithdrawalremoved delivered notices whose identifier started with<account>|<chat>. iOS names a pushed notification itself, either a random id or the push'sapns-collapse-id, and the notification service extension cannot change it. So nothing was ever withdrawn.The fix.
AnotherIMShared/AppPushThread.swiftbuilds the thread id<account>|<chat>, lowercased. A room's private message joins its room's thread, as before.threadIdentifier, and the withdrawal matches delivered notices bythreadIdentifier.What the server changes mean for iOS.
apns-collapse-id, so a chat's newer notice replaces the older one.apushCalls: onlyno longer receive messages over PushKit. Current master already registers correctly.Tests.
AnotherIMTests/PushThreadTests.swiftchecks the thread's form, and that only the chat's own thread is withdrawn. A longer domain or another account's thread is left alone.Not compiled with Xcode. The pure parts,
AppPushThreadand the matching function, compile with swiftc 6.0 in Swift 6 mode and pass the same checks. swiftlint with the repo config reports nothing. Please build and run the tests in Xcode before merging.🤖 Generated with Claude Code