mirror of
https://github.com/block/buzz.git
synced 2026-11-24 02:02:07 +00:00
A notification reply goes out as whatever account its community signs with when the reply is sent. No sign-in path replaces a community's account in place today: signing in again as another account adds a new community, and hosted re-entry refuses a different key. But nothing tied a reply to the account its notification was for, so a future in-place credential replacement would let a reply typed for the earlier account go out as the new one, or land in its drafts. Each reply is now tied to the account its notification was for: - The notification service extension records that account in the reply context, and iOS carries it through the reply journal, so a reply recovered on a later launch keeps it too. - The app sends a reply, or keeps it as a draft, only while the community still signs as that account (the key it signs with). It checks again after connecting. - Otherwise the reply ends as lost: iOS shows "Reply not sent" with the text, and no draft is kept. This is the same path a reply takes when its community has been removed ([ADR 0004](docs/adr/0004-notification-reply.md), updated here). - A reply to a notification posted by an earlier build has no recorded account, so it is checked only by its community, as before. ### Regressions - A community whose notification snapshot has no account key offers no reply action. Every signed-in community has one, since the snapshot falls back to the key derived from its secret. - No extra work on the send path beyond a key comparison. ### Validation - [notification_reply_test.dart](https://github.com/block/buzz/blob/notification-reply-account/mobile/test/features/channels/notification_reply_test.dart): a live reply for another account and a recovered one for another community end as lost with their text kept nowhere; a reply whose community's signing key is replaced while the relay connects (same community and stored key) is neither sent nor drafted; a reply from an earlier build without an account is sent. - [BuzzNotificationReplyTests.swift](https://github.com/block/buzz/blob/notification-reply-account/mobile/ios/BuzzPushKit/Tests/BuzzPushKitTests/BuzzNotificationReplyTests.swift): the resolver records the notification's account, lowercased. An empty account is rejected, and the account survives the journal round trip. - No simulator run: the reply action needs a real push resolved by the notification service extension, which the simulator can't receive. The change is covered at both layers by the tests above, and the iOS app builds. --------- Signed-off-by: Tom Brow <tomb@block.xyz>