fix(instance): 修复实例窗口 431 与认证失效 - #45
Merged
Merged
Conversation
mmyddd
commented
Sep 12, 2026
Contributor
- 每个实例使用独立浏览器数据目录:Windows/Linux 走 WebView2 data_directory,macOS 走 WKWebView data store id,避免按 authority 命名、有效期 30 天的 dsh-auth cookie 随实例换端口无限累积,撑破 node:http 16 KiB maxHeaderSize 后所有请求(含携带 token 的)直接返回 431
- 打开已存在的实例窗口时重新导航到最新的 dsh web 令牌 URL,并记录每个窗口最后使用的地址,实例重启后不再停留在过期的认证失败页面
- 导航前清除该实例自身的失效 dsh-auth cookie;Windows 上 cookie 读取放在工作线程,规避 wry 记录的同步命令/事件处理器死锁
- 无可用地址且实例已不在运行时清理该实例浏览器数据并报错,实例仍在启动中则保留窗口不导航
- 删除实例时一并清理其浏览器数据目录
- 新增 loopback_origin 与 dsh-auth cookie 名派生单测
- 每个实例使用独立浏览器数据目录:Windows/Linux 走 WebView2 data_directory,macOS 走 WKWebView data store id,避免按 authority 命名、有效期 30 天的 dsh-auth cookie 随实例换端口无限累积,撑破 node:http 16 KiB maxHeaderSize 后所有请求(含携带 token 的)直接返回 431 - 打开已存在的实例窗口时重新导航到最新的 dsh web 令牌 URL,并记录每个窗口最后使用的地址,实例重启后不再停留在过期的认证失败页面 - 导航前清除该实例自身的失效 dsh-auth cookie;Windows 上 cookie 读取放在工作线程,规避 wry 记录的同步命令/事件处理器死锁 - 无可用地址且实例已不在运行时清理该实例浏览器数据并报错,实例仍在启动中则保留窗口不导航 - 删除实例时一并清理其浏览器数据目录 - 新增 loopback_origin 与 dsh-auth cookie 名派生单测
- macOS/iOS 走 clear_all_browsing_data 分支,该目录级 helper 在该平台无调用点, clippy -D warnings 以 never used 报错导致 Quality (macos) 失败 - 按仓库既有约定(wsl.rs 的 cfg_attr(not(windows), allow(dead_code)))为 Apple 平台加 cfg_attr allow(dead_code),行为与三平台语义均不变
Contributor
评审结论:可以合入(CI 失败已由我修复)已修复:
|
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.