Skip to content

Commit 7ed6422

Browse files
wesbillmanPinky
andauthored
fix(onboarding): add Welcome finalize skip escape hatch (#1960)
Signed-off-by: Wes <[email protected]> Co-authored-by: Pinky <44b8e82baa6e0e254e0208d68f335c283c94e7b78dd1fa10d5a49d3f13dd0435@sprout-oss.stage.blox.sqprod.co>
1 parent f20d796 commit 7ed6422

2 files changed

Lines changed: 66 additions & 1 deletion

File tree

‎desktop/src/features/onboarding/ui/CommunityOnboardingFlow.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ export function CommunityOnboardingFlow({
219219
onClick={() => void finish()}
220220
variant="ghost"
221221
>
222-
Enter without Welcome channel
222+
Skip for now
223223
</Button>
224224
) : null}
225225
</div>

‎desktop/tests/e2e/deep-link-invite.spec.ts‎

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { installMockBridge } from "../helpers/bridge";
88

99
const DEFAULT_MOCK_PUBKEY = "deadbeef".repeat(8);
1010
const TRANSACTION_STORAGE_KEY = "buzz-community-onboarding-transaction.v1";
11+
const COMMUNITY_RELAY_URL = "wss://hive.example.com";
1112

1213
const PENDING_JOIN_LINK = {
1314
id: "dl-join-1",
@@ -91,6 +92,70 @@ test("connect deep link shows a static acknowledgment during setup", async ({
9192
.toContain('"acknowledged":true');
9293
});
9394

95+
test("Welcome failure can be skipped without abandoning community onboarding", async ({
96+
page,
97+
}) => {
98+
const welcomeError = "Channel creation is not permitted.";
99+
await page.addInitScript(
100+
({ pubkey, relayUrl, storageKey }) => {
101+
window.localStorage.setItem(
102+
`buzz-machine-onboarding-complete.v2:${pubkey}`,
103+
"true",
104+
);
105+
const timestamp = new Date().toISOString();
106+
window.localStorage.setItem(
107+
storageKey,
108+
JSON.stringify({
109+
id: "txn-welcome-failure-1",
110+
source: "deep-link-join",
111+
stage: "team-intro",
112+
relayUrl,
113+
communityName: "hive",
114+
communityId: "e2e-default-community",
115+
createdAt: timestamp,
116+
updatedAt: timestamp,
117+
}),
118+
);
119+
},
120+
{
121+
pubkey: DEFAULT_MOCK_PUBKEY,
122+
relayUrl: COMMUNITY_RELAY_URL,
123+
storageKey: TRANSACTION_STORAGE_KEY,
124+
},
125+
);
126+
await installMockBridge(
127+
page,
128+
{ createChannelErrors: [welcomeError, welcomeError] },
129+
{ relayWsUrl: COMMUNITY_RELAY_URL, skipOnboardingSeed: true },
130+
);
131+
await page.goto("/");
132+
133+
await page.getByRole("button", { name: "Enter hive" }).click();
134+
135+
await expect(page.getByText(welcomeError)).toBeVisible();
136+
await expect(
137+
page.getByRole("button", { name: "Preparing Welcome…" }),
138+
).toBeEnabled();
139+
const skip = page.getByRole("button", { name: "Skip for now" });
140+
await expect(skip).toBeVisible();
141+
await skip.click();
142+
143+
const completionKey = `buzz-community-onboarding-complete.v1:${encodeURIComponent(COMMUNITY_RELAY_URL)}:${DEFAULT_MOCK_PUBKEY}`;
144+
await expect
145+
.poll(() =>
146+
page.evaluate(
147+
({ completion, transaction }) => ({
148+
completion: window.localStorage.getItem(completion),
149+
transaction: window.localStorage.getItem(transaction),
150+
}),
151+
{ completion: completionKey, transaction: TRANSACTION_STORAGE_KEY },
152+
),
153+
)
154+
.toEqual({ completion: "true", transaction: null });
155+
await expect(page.getByTestId("community-onboarding-flow")).toHaveCount(0);
156+
await expect(page.getByTestId("app-sidebar")).toBeVisible();
157+
});
158+
94159
test("persisted deep-link invite hands off to Joining after machine onboarding", async ({
95160
page,
96161
}) => {

0 commit comments

Comments
 (0)