feat(protos): refresh flipcash protobufs and support new fields + UpdateTipCard - #1211
Open
bmc08gt wants to merge 5 commits into
Open
feat(protos): refresh flipcash protobufs and support new fields + UpdateTipCard#1211bmc08gt wants to merge 5 commits into
bmc08gt wants to merge 5 commits into
Conversation
…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.
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.
…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.
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.
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/v1PhoneNumber,EmailAddress, andSubstitutionmoved out of their per-domain packages intocommon/v1. All generated-type references were updated (networkapi/,ProtobufToLocal, models). TheSubstitutiononeof caseCONTACTbecamePHONE_NUMBER_TO_CONTACT_NAMEand gainedUSER_ID_TO_DISPLAY_NAME;ChatIdrelaxed to a 16-byte min (group-chat UUIDs).New capabilities (domain + mapper support)
UserProfile.tipCardColor(fromTipCardCustomization.color.hex), and a newUpdateTipCardRPC scaffolded across api → service → repository → controller, with anUpdateTipCardErrorhierarchy.ChatType.GROUPandChatMetadata.title.DirectlySentCrypto/ReceivedCryptonotification metadata now carry an optionaluserId(their identifier oneof gained auser_idoption, previously phone-only);Notification.textSubstitutionsis plumbed through, and aSubstitution.UserIddomain variant was added.Testing
:apps:flipcash:app:assembleDebuggreen.:services:flipcashunit tests pass — updated for theChatType.GROUPaddition, the relocated proto DSL builders (common.v1.phoneNumber/emailAddress), and anUpdateTipCardrepository fake.Notes
Substitution.UserId(USER_ID_TO_DISPLAY_NAME) resolves cache-first: the normalizeduser_profilestable (fast, offline) then a network profile lookup, degrading to the server-provided fallback string only when neither resolves.text_substitutionsis plumbed through at the service-model boundary.code-ios-app.