fix(web): 登录后将浏览器时区同步到用户资料 - #1161
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: caad469419
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| timezone: data.timezone ?? 'UTC', | ||
| }, data.access_token) | ||
|
|
||
| await syncBrowserTimezone(data.timezone ?? 'UTC', dependencies) |
There was a problem hiding this comment.
Do not block login on timezone synchronization
When authentication succeeds and the browser timezone differs, this awaits the profile update before navigating. The generated client uses an unbounded fetch, so a request that stalls rather than rejects leaves the form busy and the user stuck on the login page even though the fresh token has already been stored; the error handler never runs. Run this best-effort sync without blocking navigation or give it a bounded timeout.
Useful? React with 👍 / 👎.
登录成功后,Web 读取浏览器的 IANA 时区,通过现有
PUT /users/me更新用户资料,并更新本地用户状态,解决浏览器时区没有传到后端的问题。验证:8 个登录测试、相关 ESLint、UI contract 和 diff 检查通过。Chromium 使用真实本地 OSS 后端验证:模拟 Asia/Tokyo 登录后资料写回并在刷新后保留;改回 Asia/Singapore 后刷新不覆盖;拦截时区 PUT 使其不返回,约 3.4 秒后仍进入应用。测试账号时区已恢复 Asia/Singapore。此前 mock API 检查确认请求携带新 token。本次超时修复未新增测试代码。
全量提交钩子未通过:
go test ./...在未修改的internal/agent/application出现TestIdleTimeoutToolCallRearmsCurrentWindow和TestDirectChatMintsRunAndPersistsCompletedLifecycleAfterAssistant超时相关失败。约十分钟后停止剩余全量 Go 测试与 Go lint(lint 未完成),保留前端检查结果,以HUSKY=0提交,未修改测试断言或校验规则。Fixes #1148