Skip to content

Commit eaea30e

Browse files
committed
fix(web): resolve mobile stores without architecture hints
Signed-off-by: Tom Brow <[email protected]>
1 parent c2926ac commit eaea30e

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

‎web/src/shared/lib/buzz-download.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
export const BUZZ_RELEASES_URL = "https://github.com/block/buzz/releases";
2+
/** Official iOS download destination. */
23
export const BUZZ_IOS_APP_STORE_URL = "https://apps.apple.com/app/id6779728271";
4+
/** Official Android download destination. */
35
export const BUZZ_ANDROID_PLAY_STORE_URL =
46
"https://play.google.com/store/apps/details?id=xyz.block.buzz.mobile";
57
const BUZZ_RELEASES_API_URL =
@@ -100,6 +102,9 @@ export async function detectBuzzDownloadPlatform(
100102
navigatorValue,
101103
userAgentData,
102104
);
105+
if (operatingSystem === "ios" || operatingSystem === "android") {
106+
return { operatingSystem, architecture: "unknown" };
107+
}
103108
let architecture = normalizeArchitecture(navigatorValue.userAgent);
104109

105110
if (userAgentData?.getHighEntropyValues) {

‎web/tests/e2e/smoke.spec.ts‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,12 @@ test("invite download links to the appropriate platform destination", async ({
318318
maxTouchPoints: { configurable: true, value: maxTouchPoints },
319319
userAgentData: {
320320
configurable: true,
321-
value: { platform, mobile: maxTouchPoints > 0 },
321+
value: {
322+
platform,
323+
mobile: maxTouchPoints > 0,
324+
// Store routing must not wait for desktop architecture hints.
325+
getHighEntropyValues: () => new Promise(() => {}),
326+
},
322327
},
323328
});
324329
}, device);
@@ -361,6 +366,12 @@ test("invite download links to the appropriate platform destination", async ({
361366
page.getByRole("link", { name: "Download it now" }),
362367
device.name,
363368
).toHaveAttribute("href", device.expectedUrl);
369+
await context.route(device.expectedUrl, (route) =>
370+
route.fulfill({ contentType: "text/html", body: "Store destination" }),
371+
);
372+
const destination = context.waitForEvent("page");
373+
await page.getByRole("link", { name: "Download it now" }).click();
374+
await expect(await destination).toHaveURL(device.expectedUrl);
364375
await context.close();
365376
}
366377
});

0 commit comments

Comments
 (0)