fix(funkwhale): let the log-out request finish before leaving the page

b6e3368a2 added the click on Funkwhale's own confirmation ("Yes, log me out!"), which fires POST /api/v2/users/logout. c7e5b0a27 then added the return to appBaseUrl so the assertion lands on Funkwhale rather than on the logout page. Each is right on its own; together the navigation aborts the request 9ms after it starts.

Measured in all three traces of job 95883448598: the POST carries status -1 with send/wait/receive all -1 - never answered, aborted. Click at 59744ms, POST at 59876ms, goto at 59885ms. The WebSocket that follows still carries sessionid=bam0ska8z0qkbtegsp10iot028cbcsr9, and openresty logs the matching 499. Only swarm+tor is slow enough to lose the race; the other seven Funkwhale variants of that run are green.

The catch keeps those seven safe: whether their confirm click fires the same XHR is unverified, and without it a missing POST would turn them red. Promise.all rather than sequential awaits because waitForResponse has to register before the click.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
kevinveenbirkenbachandClaude Opus 5 committed 2026-08-19 16:41:09 +02:00
1 parent 4a543b3e15
commit 801923eb31
1 file changed
+9 -1
@@ -108,7 +108,15 @@ for (const persona of PERSONAS) {
.then(() => true)
.catch(() => false);
if (confirmReachable) {
await confirmSignOut.click();
await Promise.all([
page
.waitForResponse(
(r) => r.url().includes("/api/v2/users/logout") && r.request().method() === "POST",
{ timeout: resolveTimeout(15_000) },
)
.catch(() => null),
confirmSignOut.click(),
]);
}
await gotoOnion(page, appBaseUrl, { waitUntil: "domcontentloaded" });