Skip to content

fix(contacts): trigger linkForPayment on Ready and fix profile linked state#815

Merged
bmc08gt merged 2 commits into
code/cashfrom
fix/link-for-payment
May 31, 2026
Merged

fix(contacts): trigger linkForPayment on Ready and fix profile linked state#815
bmc08gt merged 2 commits into
code/cashfrom
fix/link-for-payment

Conversation

@bmc08gt

@bmc08gt bmc08gt commented May 31, 2026

Copy link
Copy Markdown
Collaborator
  • Use suspend featureFlagController.get() instead of observe().value to avoid reading the StateFlow initial value before DataStore loads
  • Await verified phone number via flow instead of bailing on null profile
  • Expose isLinkedForPayment StateFlow from ContactCoordinator (hydrated from DataStore) so UserProfileViewModel shows actual linkage state instead of deriving it from feature flags
  • Fire onAppInForeground only on AuthState.Ready (not all registered states) so linkForPayment runs at the correct time

bmc08gt added 2 commits May 31, 2026 14:43
…guard onboarding completion

Rename AuthState variants for clarity:
- Registered → Onboarding
- LoggedInAwaitingUser → Authenticating
- LoggedInWithUser → Ready

Replace the seenAccessKey boolean on Onboarding with a ResumePoint
enum (AccessKey, AccessKeyThenPurchase, PostAccessKey) so the
onboarding resume point is fully determined at state-set time rather
than derived from seenAccessKey + userFlags at navigation time.

Simplify buildNavGraphForLaunch to a pure structural mapping from
ResumePoint to nav route, removing the userFlags parameter. Add
resume-point reconciliation in RealSessionController.updateUserFlags()
for the case where flags arrive after the initial state is set.

Fix a bug where killing the app at PostAccessKey and relaunching
skipped the permissions phase entirely. A persisted completedOnboarding
flag in PassphraseCredentialManager is now checked in AuthManager.login()
before promoting to Ready, and set reactively when the composable
completes the Onboarding → Ready transition.

Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
… state

- Use suspend `featureFlagController.get()` instead of `observe().value`
  to avoid reading the StateFlow initial value before DataStore loads
- Await verified phone number via flow instead of bailing on null profile
- Expose `isLinkedForPayment` StateFlow from ContactCoordinator (hydrated
  from DataStore) so UserProfileViewModel shows actual linkage state
  instead of deriving it from feature flags
- Fire `onAppInForeground` only on `AuthState.Ready` (not all registered
  states) so linkForPayment runs at the correct time
@bmc08gt bmc08gt self-assigned this May 31, 2026
Base automatically changed from refactor/auth-state-resume-point to code/cash May 31, 2026 23:40
@bmc08gt bmc08gt merged commit 15bc68e into code/cash May 31, 2026
3 checks passed
@bmc08gt bmc08gt deleted the fix/link-for-payment branch May 31, 2026 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant