Files
buzz/mobile/test/shared
Tom Brow 8a3912f151 fix(mobile): fence notification replies by the clock and settle ones whose community is gone (#9668)
Follow-up to #9439 (iOS notification reply), which merged before these
non-blocking review points landed.

- **Publish fence checks the clock.** `mayPublish` now compares
`DateTime.now()` with the publish deadline as well as the timer flag,
before and after writing the publishing mark. After a suspension, a
pending lookup can finish before the overdue timer callback runs;
without the clock check the reply could publish past its deadline, after
iOS already showed "Reply not sent".
- **A recovered reply whose community is gone settles.** If the
community was removed, or the user signed out, before the relaunch,
`_keepDraft` used to throw, so the reply stayed in the native journal
(with its text in `UserDefaults`) and was retried on every launch. It
now keeps no draft and the reply is settled as not sent.
- **Doc fix:** `SendMessage`'s `mayPublish` is asked after signing and
after the optimistic local message is shown; the doc now says so.
- **Test fix:** the resume test asserts the EVENT frame reached the
original socket before `onAppResumed`, so the injected OK can't pass it
on its own.

### Regressions

None expected. The clock check can only refuse a publish the timer would
also refuse moments later. A recovered reply for a missing community now
drops its text instead of keeping it forever in a journal no launch can
drain; there is no community left to show it in.

### Validation

-
[notification_reply_test.dart](https://github.com/block/buzz/blob/notification-reply-fence-followup/mobile/test/features/channels/notification_reply_test.dart):
the recovered reply for a missing community now expects to be settled.
-
[relay_reconnect_resume_test.dart](https://github.com/block/buzz/blob/notification-reply-fence-followup/mobile/test/shared/relay/relay_reconnect_resume_test.dart):
asserts the EVENT frame before resume.

---------

Signed-off-by: Tom Brow <tomb@block.xyz>
Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@buzz.block.builderlab.xyz>
Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@localhost>
2026-11-20 15:25:31 -08:00
..