fix(onboarding): don't fail first run when the relay forbids member channel creation - #15
Merged
Merged
Conversation
…hannel creation
A relay running `channel_create_policy=owner-only` rejects the personal
private "Welcome" channel for every non-owner member with
restricted: only workspace owners may create durable channels or forums
`initializeStarterChannels` already treated the public starter channels as
best-effort, but `ensureWelcomeChannel` threw straight through, so first run
returned `{ok: false}` and `CommunityOnboardingFlow.finalize()` re-threw it —
painting "Couldn't set up starter channels" on a brand-new install even though
the member was fully provisioned and every shared channel was reachable.
Treat the private Welcome room as optional:
- `ensureOptionalWelcomeChannel` resolves to `{channel: null, unavailableReason}`
instead of rejecting.
- Skip the seeding, pending-channel and ready-event work when there is no
channel, and mark the welcome channel as settled so the mount effect stops
re-attempting the rejected create every ~46s.
- `resolveWelcomeFocusChannelId` lands first run on `welcome-everyone`, then
`general`, when there is no private Welcome channel.
Genuine starter-channel failures still surface as before.
Signed-off-by: mattbalza <mattbalza@users.noreply.github.com>
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.
Problem
A new teammate installed Buzz against
buzz.scalarly.organd hit a red error on first run:That message is our relay working as configured (
BUZZ_RELAY_CHANNEL_CREATE_POLICY=owner-only,crates/buzz-relay/src/handlers/ingest.rs:2260). What's broken is the client's reaction to it.Desktop's first run creates a personal, private "Welcome" channel per member. On an
owner-only relay that create is rejected for every non-owner, and:
initializeStarterChannelsalready wrapsensureStarterChannelsin try/catch, butensureWelcomeChannelthrew straight through to the outer catch →{ok: false}.CommunityOnboardingFlow.finalize()re-throws on!result.ok→ "Couldn't set upstarter channels", with "Take me to Buzz" only turning into "Skip for now" after two failures.
markWelcomeChannelEnsurednever ran, so the mount retry effect re-attempted therejected create forever — visible in the relay log as a 403 roughly every 46s.
The member was fully provisioned and every shared channel was reachable. The only thing
missing was an optional personal room.
Fix
Treat the private Welcome channel as a nicety the community may not offer:
ensureOptionalWelcomeChannel(welcome.ts) resolves to{channel: null, unavailableReason}instead of rejecting.initializeStarterChannelsskips the query-cache seeding,seedWelcomeExperience,rememberPendingWelcomeChannelandnotifyWelcomeChannelReadywhen there is no channel,and calls
markWelcomeChannelEnsuredso the retry effect stops re-attempting.resolveWelcomeFocusChannelIdlands first run onwelcome-everyone, falling back togeneral, when there is no private Welcome channel.Genuine starter-channel failures still return
{ok: false}and surface exactly as before —only the optional personal room is downgraded.
Test plan
desktop/src/features/onboarding/welcome.test.mjs— 5 new cases: success passthrough,the owner-only rejection (using the relay's verbatim message), a non-
Errorrejection,and both focus-fallback rungs. Written failing first, then made green.
3884 passed / 0 failed.pnpm exec tsc --noEmit,pnpm exec biome lint src/features/onboarding,pnpm build— clean.welcome-everyonewith no error toast; against an owner/any-member relay the privateWelcome channel is created and focused exactly as before.