Skip to content

feat(protos): refresh flipcash protobufs and support new fields + UpdateTipCard - #1211

Open
bmc08gt wants to merge 5 commits into
code/cashfrom
chore/refresh-flipcash-protos
Open

feat(protos): refresh flipcash protobufs and support new fields + UpdateTipCard#1211
bmc08gt wants to merge 5 commits into
code/cashfrom
chore/refresh-flipcash-protos

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

What

Re-vendors the flipcash proto definitions (via scripts/fetch-protos.sh) and wires the Kotlin service layer up to match.

Contract refactor — shared types consolidated into common/v1

PhoneNumber, EmailAddress, and Substitution moved out of their per-domain packages into common/v1. All generated-type references were updated (network api/, ProtobufToLocal, models). The Substitution oneof case CONTACT became PHONE_NUMBER_TO_CONTACT_NAME and gained USER_ID_TO_DISPLAY_NAME; ChatId relaxed to a 16-byte min (group-chat UUIDs).

New capabilities (domain + mapper support)

  • profileUserProfile.tipCardColor (from TipCardCustomization.color.hex), and a new UpdateTipCard RPC scaffolded across api → service → repository → controller, with an UpdateTipCardError hierarchy.
  • chatChatType.GROUP and ChatMetadata.title.
  • activityDirectlySentCrypto / ReceivedCrypto notification metadata now carry an optional userId (their identifier oneof gained a user_id option, previously phone-only); Notification.textSubstitutions is plumbed through, and a Substitution.UserId domain variant was added.

Testing

:apps:flipcash:app:assembleDebug green. :services:flipcash unit tests pass — updated for the ChatType.GROUP addition, the relocated proto DSL builders (common.v1.phoneNumber / emailAddress), and an UpdateTipCard repository fake.

Notes

  • Substitution.UserId (USER_ID_TO_DISPLAY_NAME) resolves cache-first: the normalized user_profiles table (fast, offline) then a network profile lookup, degrading to the server-provided fallback string only when neither resolves. text_substitutions is plumbed through at the service-model boundary.
  • iOS parity: the same upstream proto SHA should be re-vendored on code-ios-app.

…ateTipCard

Re-vendors the flipcash proto definitions and wires up the Kotlin service layer.

Contract refactor (types consolidated into common/v1):
- PhoneNumber, EmailAddress and Substitution moved to common/v1; updated all
  generated-type references (api, extensions, models). Substitution.KindCase.CONTACT
  became PHONE_NUMBER_TO_CONTACT_NAME and gained USER_ID_TO_DISPLAY_NAME.

New capabilities supported at the domain/mapper level:
- profile: UserProfile.tipCardColor (from TipCardCustomization.color.hex) and a new
  UpdateTipCard RPC scaffolded across api/service/repository/controller + errors.
- chat: ChatType.GROUP and ChatMetadata.title.
- activity: DirectlySentCrypto/ReceivedCrypto now carry an optional userId (the metadata
  oneof gained a user_id option), plus Notification.textSubstitutions; added a
  Substitution.UserId domain variant.

Tests updated for the ChatType.GROUP addition, the relocated proto DSL builders, and the
UpdateTipCard repository fake.
@github-actions github-actions Bot added area: network gRPC, connectivity, API, exchange rates area: notifications Push notifications, in-app messaging type: feature New functionality labels Aug 10, 2026
The USER_ID_TO_DISPLAY_NAME substitution previously degraded to the server-provided
fallback string. Resolve it properly via ProfileController.getProfileForUser (a
network-backed lookup; cache-first off the normalized user_profiles table is a natural
follow-up), falling back to the provided string only when it can't be resolved.
…ipcash-protos

* origin/code/cash:
  refactor(persistence): normalize UserProfile into a shared user_profiles table (#1210)
  fix(tests): repair unit tests broken by the new-ui v2 merge (#1212)
  feat(kmp/ed25519): in-place KMP module (JNI on Android, cinterop on iOS) + mnemonic Kotlin rewrite (#1204)
…r_profiles

Reads the display name from the normalized user_profiles table first — fast and works
offline, ideal for rendering a push — and only falls back to the network profile lookup
when the user isn't cached (then to the server-provided fallback string).

- UserProfileDao.getByUserId: cached-profile read by user id.
- UserProfileDataSource.getCachedDisplayName: resolves the name, tolerating rows still
  carrying a not-yet-backfilled migration blob (via UserProfileEntity.toSerialized).
Group chats use a server-assigned UUID rather than a derived DM id, and that path
isn't wired up yet. A TODO() stub signals 'intentionally unimplemented' more clearly
than error() (both still throw); UNKNOWN stays error() as a genuine invalid state.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: network gRPC, connectivity, API, exchange rates area: notifications Push notifications, in-app messaging type: feature New functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant