Skip to content

chore(chat): scaffold roster summary, group picture, and participation rules - #769

Merged
bmc08gt merged 3 commits into
mainfrom
chore/flipcash2-roster-rules-sync
Sep 15, 2026
Merged

bmc08gt merged 3 commits into
mainfrom
chore/flipcash2-roster-rules-sync

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator

Blocked on code-payments/flipcash2-client-protocol#12. Draft until 0.6.0 is published, because the exact: requirement in FlipcashAPI/Package.swift has no tag to resolve until then. CI never sees the local override, since FLIPCASH_PROTO_LOCAL is a shell variable.

Why

flipcash2-protobuf-api renamed three fields in place and added group-chat metadata across #93#98. Nothing was renumbered, so the wire format is unchanged, but AccessContext.profile became user_profile and the scope oneof gained a third arm, which breaks every exhaustive switch over it.

What changed

File Change
Flipcash/Core/Controllers/ProfileAvatarStore.swift .profile.userProfile at its one call site
FlipcashCore/.../Services/BlobService.swift enum case and proto field renamed, plus a new .chatProfile(ConversationID) scope
FlipcashCore/.../Conversation/Conversation.swift picture, rosterSummary, rules on the model and its proto init
FlipcashCore/.../Conversation/ConversationRules.swift new: ConversationRosterSummary, ConversationRules, and the rule enums
FlipcashCore/Tests/.../ConversationModelMappingTests.swift three tests over the new mapping

Worth a reviewer's attention

Database+Conversations.swift does not persist the three new fields. They map off the wire and live on the in-memory model, so after a relaunch they read as unset until the next network fetch. Persisting them needs new columns, a SQLiteVersion bump, and a storage shape for Rules, which is more than scaffolding should decide on its own — but it means a reviewer should not read this as "group pictures and rules now work offline".

ConversationListenerRule and ConversationSpeakerRule are kept as two parallel enums, mirroring the two parallel proto messages. Android collapsed them into one type (code-payments/code-android-app#1464), so the platforms read differently here; worth settling before anything consumes it.

MinimumBalanceRequirement drops a requirement whose currency it cannot recognize rather than failing the whole metadata mapping, so an unknown currency costs one rule instead of the conversation.

Nothing in the app reads picture, rosterSummary, rules, or builds a .chatProfile access context yet. This is scaffolding to keep the target compiling against the new contract, not a behaviour change.

…n rules

flipcash2-protobuf-api 797052dd -> 35f99814 renames Blob.AccessContext.profile
to user_profile, adds a chat_profile scope arm, and adds Metadata.picture,
roster_summary, and rules to chat.v1. Carry the rename through
BlobAccessContext and wire the new Metadata fields onto Conversation:
rosterSummary (defaulting to memberCount/version 0), picture, and the new
ConversationRules/ConversationListenerRule/ConversationSpeakerRule types in
ConversationRules.swift, mirroring the MinimumBalanceRequirement
currency-drop behavior already used for FiatAmount elsewhere in the model
layer.

BlobAccessContext gains .chatProfile for reading a group chat current
picture, but nothing constructs it yet -- no call site needs a chat-scoped
blob URL today. The SQLite cache (Database+Conversations.swift) also does
not persist picture/rosterSummary/rules yet, so a relaunch drops them until
the next fetch; both are follow-up work once there is a consumer, not
scaffolding gaps to paper over here.
0.6.0 is unpublished until flipcash2-client-protocol's sync PR merges and
publish.yml runs, so the exact: requirement has no tag to resolve until
then. The scaffold commit ahead of this builds against the local checkout
through FLIPCASH_PROTO_LOCAL, which CI never sees.
Conflict in FlipcashAPI/Package.swift. #771 moved the contract pins out of two
flat `.package(url:exact:)` lines into ContractPackage.version; this branch had
bumped flipcash2 on the old lines. Resolved to #771's structure carrying the
bump, so selective FLIPCASH_PROTO_LOCAL_PACKAGES behaviour is unchanged and ocp
stays at 0.3.0.
@bmc08gt
bmc08gt merged commit ccc263c into main Sep 15, 2026
1 check passed
@bmc08gt
bmc08gt deleted the chore/flipcash2-roster-rules-sync branch September 15, 2026 17:48
bmc08gt added a commit that referenced this pull request Sep 15, 2026
… pins (#778)

#764 bumped ocp to 0.4.0 and #769 bumped flipcash2 to 0.6.0 without regenerating
the workspace's Package.resolved, so it still recorded 0.3.0 and 0.5.0. Xcode
Cloud archives with automatic dependency resolution disabled, which turns that
mismatch into a hard error rather than a silent re-resolve: "Deploy Flipcash"
build #542 failed with "an out-of-date resolved file was detected". The vector
gate builds the SPM schemes with resolution enabled and never opens
Code.xcodeproj, so it stayed green.

Regenerated with xcodebuild -resolvePackageDependencies. Only the two contract
entries and originHash move.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant