Repository navigation
Conversation
Wrap PinMessage, UnpinMessage and GetPinnedMessages with typed Error* results, and map Pin, PinSummary, Metadata.pin_summary, MetadataUpdate.pins_changed and ViewerState.Permissions.can_pin into the domain models. The store keeps the greater pin-summary version and keeps a held summary when a feed copy omits it. Built against the local flipcash2-client-protocol override; the pin is unchanged.
bmc08gt
marked this pull request as ready for review
October 29, 2026 23:04
Store each conversation's pin count, version and latest pin (the serialized chat.v1.Pin) on its row, so a cold start and an offline launch carry the summary. A write with no summary or an older version keeps the stored pins; PinsChanged applies only when strictly newer, matching ConversationStore. Bumps Database.schemaVersion to 62.
The viewer state's CodingKeys left both permissions out, so they read back as false after a cold start. Rows written by earlier schemas still decode, with a missing key reading as false.
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.
Data and API scaffolding for chat pinned messages (flipcash2 contract
0.24.0, upstream #164). No UI.Pins
flipcash2-client-protocolto0.24.0(published from code-payments/flipcash2-client-protocol#32), withPackage.swiftandPackage.resolvedmoved together bybump-contract.sh.ConversationPin,ConversationPinSummary,ConversationPinChange,ConversationPinsPage.Conversation.pinSummary,ConversationViewerState.canPin, and a.pinsChangedstream event.ConversationStoreappliespinsChangedand keeps only the greater version.setFeedandupsertkeep a held summary when a feed row has none.ChatServiceandFlipClient+ChataddpinMessage,unpinMessage,getPinnedMessageswithErrorPinMessage,ErrorUnpinMessage,ErrorGetPinnedMessages.EncryptedChatClientandConversationControllerhandle the new case in their exhaustive switches.61 → 62: theconversationtable gainspinCount,pinVersionandpinLatest(the serializedchat.v1.Pin), so the summary survives restarts and reads offline.writeConversationupdates the pin columns only when the incoming summary's version is equal or higher, so a feed row without one never clears them..pinsChangedpersists throughDatabase.applyPinSummary, which writes only a strictly newer version.getConversations()loads the summary back.ConversationViewerStatenow encodescanInviteandcanPin. Both were left out ofCodingKeysand read back as false after a cold start, which is whatviewerStateCanInviteRoundTriponmainwas catching. Older rows decode both as false.ConversationPinTestsis new, andTransportClassificationTestsgets the new RPCs.DatabaseConversationsTestscovers the pin write rules, the cold-load round trip andcanPin.Not done yet: pinned messages in E2EE chats aren't opened. Pin and unpin results aren't applied to the store yet.