Repository navigation
fix(sess): separate runtime and transport lifecycles - #1739
Merged
Merged
Conversation
…nto refactor/sess-runtime-lifecycle # Conflicts: # sess/inst/tinytest/test-ipc.R
eitsupi
marked this pull request as ready for review
September 20, 2026 12:16
This was referenced Sep 20, 2026
Fred-Wu
approved these changes
Sep 23, 2026
Fred-Wu
pushed a commit
that referenced
this pull request
Sep 23, 2026
## Summary - separate the R runtime lifecycle from the IPC transport lifecycle - restore runtime-installed options, bindings, S3 methods, plot hooks/devices, callbacks, and rstudioapi overrides on disconnect - clean up after unexpected IPC loss and support reconnection without accumulating hooks - continue polling after transient empty reads, disconnecting only when EOF is confirmed - support runtime startup from the early R profile phase before default packages are attached - add lifecycle and transport coverage, and run the bundled sess tinytest suite in CI
eitsupi
added a commit
that referenced
this pull request
Oct 7, 2026
Close #1845 The development build already requires sess IPC protocol 2 and is incompatible with past releases. Use this compatibility break to remove the old R API compatibility layer and helpers whose roles have ended. - **`use_httpgd`, `use_jgd`, and their compatibility helpers:** `use_httpgd` was introduced in #1684, and `use_jgd` in #1706. #1817 replaced them with `plot_backend`, retaining the old arguments through `.warn_deprecated_plot_args()` and `.legacy_plot_backend()`. Extension callers already use `plot_backend`; removing the old arguments now also removes the need for these helpers. - **`register_hooks()`:** Introduced in #1684 for standalone hook registration and re-registration. It now delegates to `runtime_start()`, which `connect()` already calls directly, and has no extension callers. Re-registering also resets runtime-owned devices and viewer state without updating reconnect options, so this wrapper no longer provides a coherent independent configuration API. Keep the internal runtime lifecycle and use `connect()` as the public integration entry point. - **`rebind()`:** Introduced in #1684. #1739 migrated all callers to `.runtime_rebind()`, which records bindings for restoration when the runtime stops. Only the unused old definition remained. - **`json_rpc_response()` and `json_rpc_error()`:** Included in [#1684](#1684), but the upstream `sess` branch history shows they served the earlier HTTP `/rpc` implementation. [The WebSocket conversion](41b298a) removed their callers before sess reached main. Delete these unused HTTP response builders; the active `"json_rpc_error"` condition class remains. Update documentation, installer export checks, and test fixtures to match. Backend selection, fallback, and reconnect behavior remain unchanged, and the IPC protocol stays at version 2. Breaking API change: `connect()` no longer accepts `use_httpgd` or `use_jgd`, and `register_hooks()` is no longer exported. Use `plot_backend` and `connect()` instead.
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.
Summary
Fixes #1726.