Files
buzz/mobile/lib/shared/hosted/hosted_flow_problem_message.dart
Wes 75854111b8 fix(mobile): retain invite keys and reject incomplete onboarding (#8753)
Self-hosted invite claims retain the generated identity in secure
storage before the HTTP request and reuse it after a lost response or
restart. Saving or reopening an existing destination retires the
matching journal. Sign-out/removal deletes all matching pending key
copies before removing the saved community, preserving the community for
retry if cleanup fails.

Pairing verifies that relay authentication completed before
saving/activating a destination or reporting success. On iOS 16, hosted
entry permits recovery and reuse of backed-up identities, including
binding a recovered identity with a confirmed backup receipt. Paths
requiring a new secure backup explain the iOS 17 requirement before
generating or binding a new key. Self-hosted entry remains available.

### Validation

- Initial focused entry/recovery files: 83 passed, 1 skipped. Review-fix
focused storage, community, invite and hosted files: 82 passed, 1
skipped; extended invite journey: 17 passed, 1 skipped.
- Final hosted journey extension: 20 passed, including both bound and
unbound recovery with native sealing unavailable.
- Isolated mutations removing invite retention, pairing validation,
journal removal/re-entry cleanup or restoring the blanket platform gate
fail their intended regressions. Restored controls pass.
- iOS simulator build passed on the original integration base; final
native/device acceptance remains outstanding.
- Carl and three specialist reviewers found no source-review blockers at
`323cec6ea2`. `a55a246857` adds analyzer fixes, copy cleanup and the
recovered-unbound journey coverage. Reviewers did not run tests or the
app.

- Fixed a push-hook timeout in `4564b3562a`: idle serial queues now
release completed futures, avoiding scheduler retention across widget
tests while preserving in-flight ordering and failure isolation. The
existing dispatcher journey fails promptly before the fix and passes
afterward; Carl reviewed this delta with no blockers. Focused
dispatcher/invite/storage checks passed, and all 20 hosted journeys
passed with hosted auth enabled.

- Mandatory pre-push checks passed at `4564b3562a` (scope, branch skew,
file size, mobile analysis/tests and crypto package checks); GitHub head
verified at that commit.

### Remaining acceptance

Draft pending agent/device and human acceptance. Exercise interrupted
one-use invite claim and retry across restart, sign-out then reopen
without restoring the removed identity, rejected self-hosted pairing,
iOS 16 backed-up identity recovery (including binding), and iOS 16 new
setup blocked before key creation. Synthetic network/storage boundaries
do not prove native durability or live server behavior. Hosted CI
results are not claimed here.

Optional follow-ups remain outside this patch: pruning provably
unadmitted journals, malformed-record recovery, avoiding an iOS 16
dead-end device-key selection, and pre-existing removal/push-revocation
ordering.

This PR contains three existing-path fixes. The two organization-login
fixes depend on #8700 and remain separate: its stale parent conflicts
with main in unrelated relay code, and the required branch-skew hook
prevents publishing that stack unchanged. This PR does not refresh that
parent or change deployment policy.

---------

Signed-off-by: Wes <wesbillman@users.noreply.github.com>
Co-authored-by: Brain <1a02c72794dcd0f07058a353bc3a81f4028b8c77c92c87fce6d5c8b85970a20b@buzz.block.builderlab.xyz>
2026-10-30 10:38:24 -06:00

47 lines
2.9 KiB
Dart
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import 'hosted_flow.dart';
String hostedFlowProblemMessage(
HostedFlowProblem? problem,
) => switch (problem) {
HostedFlowProblem.communityCreationRejected =>
'This community could not be created. Leave setup to choose another address, or check your hosted community limit in Builderlab.',
HostedFlowProblem.unsupportedEnvironment =>
'This community needs a different or unsupported Builderlab environment. Use an app build configured for this community.',
HostedFlowProblem.accountSetupRequired =>
'This account is not eligible for Buzz yet.',
HostedFlowProblem.invitePolicyRequired =>
'The community policy needs to be accepted again. Try again to review it.',
HostedFlowProblem.inviteExpired =>
'This invite has expired. Ask for a new invite link.',
HostedFlowProblem.inviteExhausted =>
'This invite has no uses left. Ask for a new invite link.',
HostedFlowProblem.inviteInvalid =>
'This invite is not valid. Ask for a new invite link.',
HostedFlowProblem.inviteRestricted =>
'This account, or the account that owns it, is restricted in this community. Contact a community administrator. If the restriction is temporary, try again after it ends.',
HostedFlowProblem.inviteOwnerMismatch =>
'This account does not match its recorded owner. Use the correct account or owner identity to join this community.',
HostedFlowProblem.denied => 'This account does not have access.',
HostedFlowProblem.differentAccount =>
'Your browser signed in to a different account. Sign in to your original account on the web, then reopen setup. Your saved account and keys have been kept.',
HostedFlowProblem.identityUnreadable =>
'Your saved identity could not be read safely. Leave setup and recover access to this device’s secure storage before continuing.',
HostedFlowProblem.unsupportedPlatform =>
'Creating a secure backup requires iOS 17 or later. Update iOS to continue. You can still use self-hosted communities.',
HostedFlowProblem.backupUnavailable =>
'Secure backup is not supported on this device yet. Your identity has been kept; joining requires a confirmed backup.',
HostedFlowProblem.requestRejected =>
'The account service could not accept this setup request. Your saved account and identity have been kept.',
HostedFlowProblem.invalidResponse =>
'The account service returned a response this app cannot safely use. Setup has stopped.',
HostedFlowProblem.identityMismatch =>
'This account uses a different identity. Your saved identity has been kept.',
HostedFlowProblem.backupRequired =>
'Your identity needs a confirmed cloud backup before joining. Your saved key has been kept.',
HostedFlowProblem.bindingRequired =>
'Connect your identity from the account setup page first.',
HostedFlowProblem.identityUnavailable =>
'We could not safely recover an identity for this account. Your saved keys have been kept.',
_ => 'We could not finish connecting. You can try again.',
};