Repository navigation
fix(session): “最近登录过”过了 5 分钟就改成没有,服务器拒过一次也不再让人白填 - #627
Merged
Merged
Conversation
会话只在打开时读一次“最近登录过”,之后删账户、删 Agent、撤销电脑这类确认框一直照它显示: 登录过了 5 分钟还让人勾选、打字,点了才被服务器拒;关掉再开又填一遍、再拒一次 (agent-room-ops#34,同一个人 21 秒里被拒两次)。 现在会话机读到以后照页面自己的钟 5 分钟就改成没有(只会比服务器晚,不会比它早), 发往控制面的请求回 authentication.reauthentication_required 时也马上改,各处一起换成“重新登录”。 接口不加字段:会话的回答在网页和桌面端都是严格校验的。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
rainyflash
enabled auto-merge (squash)
October 28, 2026 06:33
This was referenced Oct 28, 2026
rainyflash
added a commit
that referenced
this pull request
Oct 28, 2026
- 身份服务的 LOGIN_ERROR already_logged_in / invalid_code:已经登录的浏览器又提交了一次登录页, 控制面随即送回房间;和 RESTART_AUTHENTICATION_ERROR 那条是同一件事。 - 控制面的 ReauthenticationRequired:最近登录的 5 分钟刚过时点了确认,网页按自己的钟只会晚几秒, 服务器拒了以后确认框马上改成重新登录(#627)。 Fixes rainyflash/agent-room-ops#37 Fixes rainyflash/agent-room-ops#38 Fixes rainyflash/agent-room-ops#40 Co-authored-by: Claude Opus 5.5 <noreply@anthropic.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.
Fixes rainyflash/agent-room-ops#34
为什么
生产上有人删账户,21 秒里被服务器以“要最近登录过”拒了两次。日志随 Alpha 85 部署没了,照代码看是这样:
DEFAULT_RECENT_AUTHENTICATION_MILLIS)。改了什么
RECENT_AUTHENTICATION_WINDOW_MS)。只从读到的那一刻起算,所以只会比服务器晚、不会比它早,电脑的钟不准也不会多让人登录。ReauthenticationWatch包在注入的控制面 fetch 外面:回答是 401authentication.reauthentication_required时通知会话(读的是副本,调用方照常读自己的),会话马上改成没有。上面那一段“晚”的就由它补上,以后新加要最近登录的操作也不用自己接。不加噪音规则:修好以后这行告警还会在少数时候出现(页面在登录几分钟后才打开、旧版缓存),新版上再来会重新打开,到时候看次数再定。
怎么查的
ready;服务器通知以后马上改,退出登录以后再通知不碍事,停下以后退订。ReauthenticationWatch:只有 401 加这个错误码才通知,别的 401、不是 JSON 的、403、200 都不算,调用方照常读到原来的回答,退订以后不通知。tsc、eslint、prettier都过。suite=session(真实网页登录与会话恢复)。🤖 Generated with Claude Code