chore(flipcash): follow flipcash2 contract 3d6de707 (client 0.13.0) - #1625
Merged
Merged
Conversation
…ule and assigned username Adapt to the flipcash2 contract at 3d6de707 (built against a local checkout, pin unchanged): - ChatType.TIP_DM -> DM and DmPayment/FLIPCARD renames in the proto mapping; the domain ChatType.TIP_DM stays because it is persisted by name. - Map SpeakerRules.never to ChatRuleRequirement.Never, including persistence. - Map messaging Content.widget to MessageContent.Widget (ShareProfile / Unsupported), including persistence and the exhaustive whens in chat-ui. - setDisplayName now returns the server-assigned username and the controller caches it.
bmc08gt
marked this pull request as ready for review
September 30, 2026 15:23
bmc08gt
added a commit
that referenced
this pull request
Sep 30, 2026
#1625 changed ProfileController.setDisplayName to return the server-assigned username as Result<String?>. NameEntryViewModelTest still stubbed Result<Unit>, so the module's unit tests no longer compiled.
bmc08gt
added a commit
that referenced
this pull request
Sep 30, 2026
…count (#1630) * fix(login): stop logging in as other accounts to name switcher rows The account switcher named each row by calling the Login RPC signed as that row's account, then GetProfile with the user id it returned (AccountProfileFetcher, from #1626). The app must not sign in as an account the user has not switched to, and iOS dropped the same call. Android stores no user id for accounts other than the signed-in one, so there is no GetProfile call left that avoids Login. Rows now take their username and display name only from AccountProfileCache, which is written while each account is signed in. An account that has never signed in on this device keeps its mnemonic name. The fallback order is unchanged: @username, then display name, then mnemonic name. The balance fetch per row is unchanged. It signs a read as the row's owner key but does not call Login or start a session. * feat(login): fetch switcher profiles by a user id cached at sign-in Rows for other accounts could only show the name cached while that account was signed in, because the user id GetProfile needs was never stored. AccountProfileCache now keeps each account's user id alongside its names, taken from UserManager's state while the account is signed in. NoId, the value clear() leaves at sign-out, is skipped. A row with a cached user id fetches its profile with GetProfile by that id, signed with the row's owner key the way the balance fetch signs. A row without one makes no profile call. AccountProfileFetcher now takes the user id and depends only on ProfileRepository and the cache, so it has no path to the Login RPC. Accounts that last signed in before this change have no cached user id until their next sign-in on this device, and keep their cached or mnemonic name until then. * fix(user-profile): stub setDisplayName with its String? result #1625 changed ProfileController.setDisplayName to return the server-assigned username as Result<String?>. NameEntryViewModelTest still stubbed Result<Unit>, so the module's unit tests no longer compiled. * fix(login): resolve a missing user id with Login as the last fallback A switcher row with a cached user id still calls GetProfile by that id. A row without one now calls Login signed with its own owner key, caches the user id it returns, then calls GetProfile. The cached id means each account goes through Login at most once on this device. This matches code-payments/code-ios-app#918, which calls login(owner:) only when a row has no stored user id and its database has none either. Android has no database step, so Login follows the cache directly.
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.
Blocked on code-payments/flipcash2-client-protocol#19 (code-payments/flipcash2-client-protocol#19) merging and 0.13.0 being published. Until then
com.flipcash:flipcash2-client-protocol:0.13.0does not resolve, so CI stays red.Follows the flipcash2 contract to
3d6de707:ChatType.DM,ChatMetadata.DmPaymentandLocation.FLIPCARDare updated in the proto mappers andDmPaymentMetadata.kt. The domainChatType.TIP_DMkeeps its name because Room persists it by name, and renaming it needs a migration.SpeakerRules.never: newChatRuleRequirement.Never, mapped both ways, persisted, and never satisfied inGroupAccess.ListenerRuleshas noneverarm, soasProtoListenerRulesthrows for it.Content.widget: newMessageContent.Widget, eitherShareProfile(username)orUnsupportedfor unknown variants, and persisted.MessageBubbleand the chat summary preview do not render it yet (TODO).SetDisplayNameResponse.username:ProfileController.setDisplayNamereturns and caches the assigned username.NameEntryViewModeldoes not act on it yet.