Repository navigation
refactor(chat): drop the deprecated new_messages overlay - #757
Merged
bmc08gt merged 1 commit intoSep 11, 2026
Merged
Conversation
`ChatUpdate.new_messages` is marked `[deprecated = true]` in the contract, superseded by the sequenced, gap-detectable `events` batch. The decode path kept it as an additive overlay so a message arriving only there was never dropped; the backend now sends `events` and leaves `new_messages` empty, so the overlay only costs a second pass over an empty batch and an enum case every switch has to carry. `.chatEvents` already covers what the `.newMessages` arm did. The store's last-activity bump is the same, restricted to `.sent` mutations so an edit or delete can't move a feed row on its original low id; the controller's persist arm matches, plus the cursor write that makes messages and the advanced frontier land atomically. Ported the ordering and messages-plus-typing decode tests to `events`, and the receipt-wiring and backlog tests to `.chatEvents` via a new `ConversationStreamEvent.sent` helper. Deleted the tests that only covered the overlay itself, including the store's last-activity test — `chatEventsBumpsActivity` already asserts it.
bmc08gt
added a commit
that referenced
this pull request
Sep 11, 2026
`ChatUpdate.new_messages` is marked `[deprecated = true]` in the contract, superseded by the sequenced, gap-detectable `events` batch. The decode path kept it as an additive overlay so a message arriving only there was never dropped; the backend now sends `events` and leaves `new_messages` empty, so the overlay only costs a second pass over an empty batch and an enum case every switch has to carry. `.chatEvents` already covers what the `.newMessages` arm did. The store's last-activity bump is the same, restricted to `.sent` mutations so an edit or delete can't move a feed row on its original low id; the controller's persist arm matches, plus the cursor write that makes messages and the advanced frontier land atomically. Ported the ordering and messages-plus-typing decode tests to `events`, and the receipt-wiring and backlog tests to `.chatEvents` via a new `ConversationStreamEvent.sent` helper. Deleted the tests that only covered the overlay itself, including the store's last-activity test — `chatEventsBumpsActivity` already asserts it.
This was referenced Sep 11, 2026
bmc08gt
added a commit
that referenced
this pull request
Sep 11, 2026
…discrete-curve * origin/main: (27 commits) fix(database): share one SQLite writer per owner and take write locks up front (#759) feat(chat): declare the payment action on tip DM payments (#752) refactor(chat): drop the deprecated new_messages overlay (#757) feat(notifications): write prefetched messages into the shared store (#756) refactor(store): move the persistence layer into a shared FlipcashStore package (#755) feat(database): move the SQLite store into the App Group container (#754) feat(database): open the store on demand, close it on background (#753) feat(nse): extension crash reporting, a WAL checkpoint, and on-device push hooks (#751) feat(home): long-press the You tab to open the account switcher (#749) fix(tests): reset Photos access before the previous app instance lingers (#746) chore: bump version to 2026.9.2 (#745) revert: back out the Coinbase Stable Swapper authority migration (#747) (#750) fix(swap): follow the Coinbase Stable Swapper authority migration (#747) fix(tests): cancel a cash link through the details screen (#744) fix(chat): make the whole Send Cash pill tappable while it stands alone (#743) fix(username): drop a leading @ in the validator (#742) fix(chat): scope the send-button spring to the button (#741) fix(transactions): tighten the details card stack and drop the header badge (#740) fix(transactions): draw View in Chat as a card, not the primary action (#739) feat(chat): flash the message a reply-quote jump lands on (#738) ... # Conflicts: # Code.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved # FlipcashCore/Package.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ChatUpdate.new_messages(field 2) is marked[deprecated = true]inflipcash2-protobuf-api, superseded by the sequenced, gap-detectableeventsbatch (messaging.v1.EventBatch, field 6). The decode path kept it as an additive overlay so a message arriving only there was never dropped. The backend now sendseventsand leavesnew_messagesempty, so the overlay only costs a second pass over an empty batch and an enum case that every switch overConversationStreamEventhas to carry.Nothing is lost
.chatEventsalready covers what the.newMessagesarm did, in both places that handled it:.newMessagesarm bumped last activity to the newest message by id.applyChatEventsdoes the same, restricted to.sentmutations, so an edit or delete can't move a feed row on its original low id. That restriction is the correct behaviour, not a regression..newMessagespersist arm read the analytics watermark, reconciled pending sends, wrote messages, counted receipts, and scheduled a gap catch-up on a failed write. The.chatEventsarm does all of it, plus the cursor write that makes the messages and the advanced frontier land atomically.upsertConversationMessages, which only the removed arm called on this path, is still used by the send, load-older, and mutation paths.Tests
Ported, because they cover ordering, receipt wiring, and backlog handling rather than the deprecated field:
ConversationStreamEventDecodeTests— the decode-ordering and messages-plus-typing cases now buildeventsfixtures.ConversationControllerTestsandConversationReceiptWiringTests—mock.emitnow goes through a newConversationStreamEvent.sent(_:in:)test helper that wraps messages as one contiguous run of.sentmutations. The reconnect-replay dedup still holds: the second emit reads a watermark that already includes the message, so it isn't re-credited.Deleted, because they only existed to cover the overlay:
new_messagesdecode test (chatEventsDecodecovers decoding events),chatEventsAndNewMessagesAdditiveandemptyEventsKeepsNewMessages, both migration-window gates,ConversationStoreTests.newMessagesBumpsActivity—chatEventsBumpsActivityalready asserts the same last-activity behaviour over.chatEvents, so re-expressing it would have duplicated an existing test.Notes
Stacked on #756, which is itself the top of the NSE preload stack. The commit doesn't depend on that stack — the only thing those PRs change in the files touched here is three
import FlipcashStorelines — so it can be re-parented ontomainif the stack is going to sit.A matching removal is queued for Android (
EventStreamDelegate.applyUpdate, which uses the field as an exclusive fallback rather than an additive overlay). The two are independent.