The peer lobby stays on "Checking account..." when an invite link is opened with site data blocked

未关闭
#626 3 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

@dges5202 已经在做这个了。

开始于 2026年11月8日。

  • #632 来自 @dges5202 —— 未关闭

评估

这个 Issue 还没有评估数据。

描述

Problem

web/peer-lobby.js names the sessionStorage global in five places (lines 29, 187, 253, 262 and 266 at fcae4d8). Where site data is blocked, touching that global throws. #603 fixed the same failure in the lobby and left these five references behind per-line eslint-disable-next-line no-restricted-globals directives, because a mechanical conversion does not fix this page; the maintainer asked for a separate issue in the review of #603.

Current behavior

Reproduced on fcae4d8 in Chromium:

  1. With the CodeTrial origin added to Chrome's "Not allowed to save data on your device" list (chrome://settings/content/siteData), open /peer-lobby#invite=test. The page stays on "Checking account...", and the console shows Uncaught SecurityError: Failed to read the 'sessionStorage' property from 'Window': Access is denied for this document. The address bar still carries #invite=test: the history.replaceState that should drop it, two lines after the sessionStorage.setItem at line 29, never runs.
Image

 

  1. With site data allowed, the same link moves on: the invite leaves the address bar and the signed-out page goes to /api/login?next=peer-join (on this local server, without GitHub sign-in configured, that answers a JSON error, which is outside this issue).

Cause

Line 29 runs at module scope: when the URL carries an invite, the page stores the token in sessionStorage and then removes it from the URL. With the global throwing, the module stops there and init() never runs. Lines 187 and 253 run in init() outside any try, so a page that gets past module scope still fails there.

Converting the references to storageArea("sessionStorage") would pass the lint rule but still fail: .setItem and .getItem on the null it returns throw too. The token has to survive the trip to /api/login?next=peer-join and back (line 188), and sessionStorage is the only place the page keeps it.

Desired outcome

With site data blocked, the peer lobby never hangs or shows a raw exception, and it tells the candidate why peer interviews cannot start there.

Open question

Signing in needs the session cookie, which the same block refuses, so a candidate under a full block cannot join a peer interview whatever happens to the token. Is it enough to detect the block (as the lobby does with tabStorageBlocked) and show a site-data message like the lobby's, without trying to keep the token? Or should the token stay in the URL until the join succeeds, for a browser that blocks storage but not cookies?

Acceptance criteria

  • Opening an invite link with sessionStorage unreachable shows a reason instead of "Checking account...", and a test covers it.
  • The five eslint-disable-next-line directives in web/peer-lobby.js are gone; reportUnusedDisableDirectives makes each fix remove its own.

Related

#600 and #603 (the same failure in the lobby).

I found this while working on #603 and am not taking it myself; it is open for anyone to pick up.

主要语言
Rust
星标
223
派生
148
平均合并
1 天 4 小时
30 天内合并 PR
223

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

sysprog21/codetrial 的其他 Issue

查看 sysprog21/codetrial 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。