--reconnection-grace-time does not survive closing the browser tab
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 55/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
Hướng nghiên cứu
Trước tiên, hãy theo dõi việc xử lý pagehide/beforeunload của BrowserLifecycleService và quá trình dọn dẹp graceful dispose của ManagementConnection. Sau đó kiểm tra đường dẫn rút ngắn kết nối của RemoteExtensionHostAgentServer; hoàn tất khi một grace period được cấu hình vẫn tồn tại qua việc đóng tab và một kết nối thứ hai, trong khi các cài đặt sử dụng mặc định vẫn giữ nguyên hành vi mặc định.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem
--reconnection-grace-time (added in #7678) is documented as "Override the reconnection grace time in seconds. Clients who disconnect for longer than this duration will need to reload the window."
In practice the setting cannot deliver that, for two independent reasons.
1. Closing the tab bypasses the grace time entirely.
BrowserLifecycleService listens on pagehide/beforeunload and runs the workbench shutdown, which disposes the remote connection gracefully. On the server, ManagementConnection treats a graceful dispose as a finished client:
Event.once(this.protocol.onDidDispose)(() => {
this._log(`The client has disconnected gracefully, so the connection will be disposed.`);
this._cleanResources();
});
_cleanResources() runs immediately — the grace time is never consulted. So closing the tab kills the session regardless of the configured value.
2. A second connection cuts the grace time to 5 minutes.
RemoteExtensionHostAgentServer shortens every disconnected connection on each new connection:
for (const key in this._managementConnections) {
this._managementConnections[key].shortenReconnectionGraceTimeIfNecessary();
}
which schedules ProtocolConstants.ReconnectionShortGraceTime (5 min). Opening a second tab is enough to cut a deliberately long grace time back down.
Impact
The use case the flag exists for — leave a long-running task (a build, a CLI, an agent session) running and come back to it later — does not work. The session is gone as soon as the browser is closed.
Expected
When an operator raises --reconnection-grace-time above the default, a disconnected session should survive for the configured duration, including across a closed browser. Installations that never set the flag should keep Code's stock behaviour.
Environment
Reproduced on code-server 4.128.0 and confirmed present in main (4.133.0 / Code 1.133.0).
- Ngôn ngữ chính
- TypeScript
- Star
- 79.4k
- Fork
- 6.9k
- Merge trung bình
- 2 ngày 13 giờ
- Pull request đã merge (30 ngày)
- 39
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của coder/code-server
-
Bump proxy-addr to 2.0.8 Đang mởsecurity
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
coder/code-server#8013 · 3 bình luận ·
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
coder/code-server#7976 · 2 bình luận ·
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
coder/code-server#7962 · 3 bình luận ·
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 42/100
coder/code-server#7948 · 1 bình luận · 2 reaction ·
-
bug code-server needs-investigation
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
coder/code-server#7938 · 3 bình luận · 2 reaction ·
Tất cả issue của coder/code-server
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
0xMiden/bridge-portal#132 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
area:tools bug good first issue help wanted priority:P2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
TaewoooPark/Motifcode#14 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
newrelic-experimental/preflight#793 · 1 bình luận ·