Repository navigation
feat: keep messages pending while offline - WPB-25320 - #5447
Conversation
…ng-message-foundation-WPB-26307
…ng-message-foundation-WPB-26307
|
Please make sure new localizations are translated once merged to develop. New strings (English):
|
…ng-message-foundation-WPB-26307
…ng-message-foundation-WPB-26307
…ng-message-foundation-WPB-26307
…ng-message-foundation-WPB-26307
…at/pending-message-foundation-WPB-26307
acv-w
left a comment
There was a problem hiding this comment.
One P2 issue in pending-message editing.
…at/pending-message-foundation-WPB-26307
acv-w
left a comment
There was a problem hiding this comment.
The send-history concern is fixed in 5a2db42. I checked attempt persistence with the flag off, the default for legacy records, and the new retry and migration tests.
CI still fails because FlagSection.init(flag:) in DeveloperFlagsView.swift does not handle .offlinePendingMessages. This build error must be fixed before merge.
🎉 All green!🧪 All tests passed 🔗 Commit SHA: e2fb5ee | Docs | View more details | Give us feedback! |
…ng-message-foundation-WPB-26307
…ng-message-foundation-WPB-26307
…ng-message-foundation-WPB-26307
…ng-message-foundation-WPB-26307
The 2.118.0 fixture used the current message-composition API, which now writes sendAttemptStarted from schema 2.146.0 and raises an unrecognized-selector exception on the old model. Construct fixture messages directly with source-schema fields and document why this setup must stay independent of current composition requirements. Validation: targeted migration test passed locally as confirmed by the developer; SwiftFormat, SwiftLint, and git diff --check passed.
jullianm
left a comment
There was a problem hiding this comment.
Reviewed the current revision, including the send-history and expired-request fixes from the previous review. One remaining P2 issue: the new in-place edit/delete safety check does not cover the link-preview send path.
Validation: traced both send paths and the preview preprocessing/selection code at this commit. I did not run the iOS test suite locally. SwiftLint and SwiftFormat pass; PR tests were still pending when checked.
Issue
Milestone 0 of the PRD "Pending connection, pending invite, pending message", covering pending messages only. Pending connections and invites are not part of this PR.
Today a message written while offline fails after about 60 seconds and has to be resent by hand. With the new developer flag
offlinePendingMessagesturned on, text messages stay pending and are sent automatically once the network is back, including after an app restart.Approach: this extends the existing send path in
ClientMessageRequestStrategyand doesn't add a separate outbox.sendAttemptStartedattribute: added toClientMessagein data model 2.146.0. It's set just before the first send attempt.sendAttemptStartedis false, editing a pending text message replaces its text and keeps the nonce. Receivers only see the final text, without an "Edited" marker. Once sending has started, the normal edit is used, or an alert is shown if the edit races with the send.sendAttemptStartedis false, a new pending text message can be deleted ("Delete for Me"). It's removed locally only, since nobody else has it.Edits and deletes of pending messages run on the sync context, which is also where the strategy sets
sendAttemptStarted, so they can't race with a send.Ephemeral messages and assets keep today's behaviour.
Known limitations / follow-ups
sendAttemptStartedis already set, so the message can no longer be edited or deleted in place.Testing
Turn on Developer settings →
offlinePendingMessagesand restart the app. Use a second account to receive.Checklist
[WPB-XXX].UI accessibility checklist