feat(sess)!: stabilize attach identity and endpoint contract - #1764
Conversation
|
Given the recent large
In addition, during the review, there appears a bug. A VS Code reload may clean up the workspace callback while it is still sending notifications, which could crash R. It has been suggested to use |
|
@Fred-Wu Could you please take another look? |
This comment was marked as outdated.
This comment was marked as outdated.
|
Thanks for supporting the downstream applications. This might be another bug for native R terminals. When VS Code is reloaded, R process survives, but Here is a small demo. R.restore.mp4 |
|
@Fred-Wu I believe I've fixed the bug you pointed out, so could you please check it again? |
|
Connections are now correctly restored automatically after VS Code reload. But Remove or fix in the next release? |
Thanks for pointing that out! |
Summary
On master, sess identity and discovery depend on local PIDs and
~/.vscode-R/sessions/<PID>.json. Reloading VS Code leaves surviving R processes disconnected, and restoring one terminal can prevent manual recovery of another. This PR establishes the session contract before the first stable 3.x release (#1763).session_id. Use socket ownership for cleanup so a late close cannot remove a replacement connection; defer workspace and plot notifications until task callbacks return, with generation guards across disconnects.sess::connect(endpoint = ...),SESS_ENDPOINT, andSESS_DISCOVERY_FILE. Store managed discovery files and attach scripts in extension storage, without making its directory layout part of the contract.versionandendpoint, ignores unknown fields, and permits optional backend fields such asjgdSocketwithout a version bump.Breaking pre-release changes: replace
pipe_path,SESS_PIPE, thepipediscovery field, and the PID-based home-directory fallback. Transport remains local Unix-domain sockets / Windows named pipes.