Skip to content

feat: sync protos, add cash tip action and push chat type#516

Merged
bmc08gt merged 4 commits into
mainfrom
feat/fetch-protos-cash-tip
Jul 25, 2026
Merged

feat: sync protos, add cash tip action and push chat type#516
bmc08gt merged 4 commits into
mainfrom
feat/fetch-protos-cash-tip

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Stacked on #515 (blurhash). The base is feat/blurhash-avatar-placeholders because both branches touch Schema.swift / Info.plist (each bumps SQLiteVersion), so this must land after #515. Retarget to main once #515 merges.

What

Regenerate the Core and Payments (OCP) Swift bindings and wire the two new Core proto fields that need consumers. Adds the /fetch-protos skill + proto-change-tracer agent used to produce this.

Proto sync

Both domains regenerated via Scripts/run. Only Core changed, with three additive fields:

  • chat.Metadata.is_hidden
  • messaging.CashContent.action (Action { SENT, TIPPED })
  • push.Payload.chat_metadata (+ ChatMetadata { sending_user_id, type })

Note on .grpc.swift churn — dropped Sendable

A large chunk of the *.grpc.swift diff is a codegen-style change from the current protoc-gen-grpc-swift-2 plugin, not a semantic change. The plugin stopped emitting : Sendable on the caseless namespace enums (e.g. Flipcash_Email_V1_EmailVerification, its nested Method, and per-RPC enums). These enums have no cases — they're uninhabited namespaces, so no instance can ever exist and Sendable on them is a no-op. Everything stateful keeps its conformance: ClientProtocol: Sendable, struct Client<Transport>, and all Result: Sendable bounds are intact, as are the message types in *.pb.swift. The app builds clean, consistent with dropping a no-op conformance.

Cash tip action (CashContent.action)

Threaded end-to-end so a tipped payment reads differently from a plain send:

  • ConversationMessage carries a CashAction, mapped from the proto (unknown → .sent, per the proto contract)
  • Persisted in a new conversation_message.cashAction column — SQLiteVersion 26 → 27
  • ChatCashContent gains isTip + a shared caption(isFromSelf:isTip:) used by both the in-app cash card and the notification transcript ("You tipped" / "You received a tip")

Push chat type (Payload.chat_metadata)

  • NotificationPayload.chatType(_:) exposes the push's DM kind, symmetric with the existing chatID / isContactJoin accessors. Behavioral routing (e.g. tip-DM notification handling) is deferred — no consumer needs it yet.

Not wired

is_hidden is intentionally left unwired — there's no user-blocking flow yet, so the flag is always false.

Testing

  • App builds clean (app + both notification extensions)
  • FlipcashCore suites pass: 35 tests / 2 suites — new coverage for the tipped-action mapping, the .sent default, and all three chatType cases
  • Two app-target tests (ChatMessageMapping tipped case, DB cashAction round-trip) are included but currently can't run: the FlipcashTests target has a pre-existing compile break under the current toolchain, unrelated to this change.

bmc08gt added 3 commits July 24, 2026 17:27
Carry the thumbnail rendition's BlurHash on ProfilePicture and render it as
an instant blurred preview while a counterpart's avatar downloads, instead
of a blank gradient. Ported from android code-payments/code-android-app#1131
(lean scope: BlurHash + placeholder; the existing largest-thumbnail
selection is kept, avatars are fixed-size).

- BlurHash: public-domain decoder + process-wide decode cache (FlipcashUI)
- ProfilePicture.thumbnailBlurhash, read off the selected thumbnail rendition
- SQLite: persist the blurhash (new column, SQLiteVersion 25 -> 26)
- ContactAvatarView renders the blurhash while imageData is nil
  (precedence: bytes -> blurhash -> monogram)
- Threaded through the tip/DM counterpart surfaces (conversation title +
  profile card, tip conversations list)
- Tests: BlurHash decoder vectors; ProfilePicture blurhash extraction +
  legacy JSON back-compat
Adds a /fetch-protos skill that regenerates the Core and Payments Swift
bindings via Scripts/run, verifies the build, and dispatches a
proto-change-tracer agent to map field/RPC changes through the
service -> client -> consumer chain.
Regenerate Core and Payments bindings. Core adds three additive fields:
CashContent.action, Metadata.is_hidden, and Payload.chat_metadata.

Wire CashContent.action through the chat stack: ConversationMessage
carries a CashAction, persisted in a new conversation_message.cashAction
column (SQLiteVersion 26 -> 27), and ChatCashContent renders a shared
sent/tipped caption in both the in-app cash card and the notification
transcript.

Add NotificationPayload.chatType(_:) exposing the push's DM kind from
Payload.chat_metadata, alongside the existing chatID/isContactJoin
accessors.

is_hidden is intentionally left unwired (no user blocking yet).
@bmc08gt bmc08gt self-assigned this Jul 24, 2026
Base automatically changed from feat/blurhash-avatar-placeholders to main July 25, 2026 00:20
@bmc08gt
bmc08gt merged commit 81388d5 into main Jul 25, 2026
@bmc08gt
bmc08gt deleted the feat/fetch-protos-cash-tip branch July 25, 2026 00:21
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