Skip to content

feat(chat): scaffold flipcash2 0.22.0 group invites - #1141

Merged
bmc08gt merged 4 commits into
mainfrom
feat/flipcash2-group-invites
Oct 27, 2026
Merged

bmc08gt merged 4 commits into
mainfrom
feat/flipcash2-group-invites

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Adapts the app to the flipcash2 0.22.0 contract (group invites), from code-payments/flipcash2-client-protocol#30. It adds no UI and no invite crypto.

Pins flipcash2-client-protocol 0.22.0; the pin and Package.resolved move together in the last commit.

  • GetKeyEnvelope: key_envelope moved into a oneof, so hasKeyEnvelope no longer exists. getKeyEnvelope switches on response.envelope, and KeyEnvelopeResult is now .own or .invite, both carrying wrappedByPublicKey. FlipClient and ChatNotificationClient treat an invite bundle as .noEnvelope for now.
  • Invite RPCs: createInvite, getInvite, getChatInvites and revokeInvite on ChatService and FlipClient, with Error* enums in proto order. Models are in ConversationInvite.swift.
  • joinChat: a separate overload takes InviteJoinParameters. A defaulted parameter would have broken ConversationMembership conformance. ErrorJoinChat gains the four invite cases at raw values 5 to 8, and Events.swift names them for analytics.
  • getRoster: takes an optional owner and invite token.
  • ConversationViewerState.canInvite and SystemEvent.userJoinedViaInvite, which still reads as a plain join. The new event is persisted in two new message columns, and schemaVersion goes from 59 to 60.

The username limit stays at 15. The contract now allows 30, but UsernameValidator, the Username regex, MentionDetector and the cash-code layout all assume 15, so that needs its own change.

…sh2 contract

Builds against flipcash2-client-protocol b655df17 through the local
override; the FlipcashAPI pin is not bumped.

GetKeyEnvelopeResponse moved key_envelope into `oneof envelope`, so
`hasKeyEnvelope` no longer compiles. getKeyEnvelope now switches on the
envelope: an invite-joined member's `inviteKeyBundle` is a distinct
KeyEnvelopeResult case and surfaces to the existing callers as
`.noEnvelope`, never a default own envelope. The wrapper also carries
wrappedByPublicKey.

- ChatService/FlipClient: createInvite, getInvite, getChatInvites,
  revokeInvite with ErrorCreateInvite/GetInvite/GetChatInvites/
  RevokeInvite in proto order; joinChat takes optional invite
  parameters and ErrorJoinChat gains the four invite cases; getRoster
  accepts an invite token with optional auth.
- Models: Invite, InviteID, InviteToken, InviteKeyEnvelope,
  InviteSecretEnvelope, InviteKeyBundle, ViewerState.canInvite.
- SystemEvent.userJoinedViaInvite for SystemContent `invited`, persisted
  in two new message columns; Database.schemaVersion 59 -> 60 (also
  covers the new ViewerState.canInvite JSON field).

Invite crypto (token/id derivation, envelope wrap and signing) and UI
are not implemented.
@bmc08gt
bmc08gt marked this pull request as ready for review October 27, 2026 19:58
@bmc08gt
bmc08gt merged commit 41627f1 into main Oct 27, 2026
4 checks passed
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