Skip to content

show the R version in the console pane at startup - #18858

Merged
kevinushey merged 3 commits into
mainfrom
bugfix/console-r-version-unknown
Sep 17, 2026
Merged

kevinushey merged 3 commits into
mainfrom
bugfix/console-r-version-unknown

Conversation

@kevinushey

@kevinushey kevinushey commented Sep 16, 2026 •

Copy link
Copy Markdown
Collaborator

Intent

Fixes #18857.

Show the Console pane's R version as soon as session info is available, without waiting for an RPC queued behind R startup work.

Approach

  • Add Session.withSessionInfo(): invoke the callback immediately when session info exists, otherwise register a one-time SessionInitEvent handler and remove it before invoking the callback.
  • Initialize the console's cached R version through that helper and remove the exception-based readiness checks.
  • Refresh the cached value after R restarts and transitions back from Python. Later refreshes display the last known version instead of rereading the startup snapshot, and RPC failures preserve that value.

Validation

  • Java compilation and a GWT draft build passed.
  • Both new SessionTests passed, covering immediate callbacks, deferred callbacks, and listener removal.
  • E2E TypeScript checking passed.
  • Both Windows Desktop regression tests passed, checking that startup sends no version RPC, a delayed refresh applies a distinct returned version, and a subsequent RPC error retains the refreshed value. The test uses real server responses to accommodate Electron's HTTP interception behavior and holds the restart-completion ping until the new session is ready.

The Console pane's interpreter label was created reading "(unknown)" and
only picked up the real version once the get_rversion_info RPC answered.
During startup that RPC waits behind whatever R is busy with, so the
placeholder is what users see for the first seconds of a session.

Session info already carries the same value (r_versions_info.r_version,
from module_context::rVersion()), so seed the label from it and let the
RPC refresh it -- which still covers a restart into a different R.
@kevinushey kevinushey added this to the 2026.10 (Blue Mistflower) milestone Sep 16, 2026
@kevinushey
kevinushey deployed to e2e-playwright September 16, 2026 23:22 — with GitHub Actions Active
@kevinushey
kevinushey deployed to e2e-playwright September 16, 2026 23:22 — with GitHub Actions Active
@kevinushey
kevinushey deployed to e2e-playwright September 16, 2026 23:27 — with GitHub Actions Active
@kevinushey
kevinushey deployed to e2e-playwright September 16, 2026 23:27 — with GitHub Actions Active
@kevinushey
kevinushey deployed to e2e-playwright September 16, 2026 23:28 — with GitHub Actions Active
@kevinushey
kevinushey deployed to e2e-playwright September 16, 2026 23:28 — with GitHub Actions Active
@kevinushey
kevinushey deployed to e2e-playwright September 16, 2026 23:41 — with GitHub Actions Active
@kevinushey
kevinushey deployed to e2e-playwright September 16, 2026 23:41 — with GitHub Actions Active
@kevinushey
kevinushey deployed to e2e-playwright September 16, 2026 23:41 — with GitHub Actions Active
@kevinushey
kevinushey deployed to e2e-playwright September 16, 2026 23:41 — with GitHub Actions Active
@kevinushey
kevinushey deployed to e2e-playwright September 16, 2026 23:41 — with GitHub Actions Active
@kevinushey
kevinushey deployed to e2e-playwright September 16, 2026 23:41 — with GitHub Actions Active
@github-actions

github-actions Bot commented Sep 17, 2026 •

Copy link
Copy Markdown

RStudio E2E - all platforms

All tests passed!

#################### 100% pass rate

Passed Failed Skipped Flaky
3066 0 187 1
Platform ✅ Passed ❌ Failed ⚠️ Skipped 🔁 Flaky
✅ auth-teardown 2 0 10 0
✅ desktop-linux 771 0 38 0
✅ desktop-macos 776 0 33 1
✅ desktop-windows 773 0 42 0
✅ server-linux 716 0 44 0
✅ setup 28 0 20 0
View / download the full report

View report online -- opens in the browser, no download needed. Available for 14 days.

Download playwright-report.zip -- extract and open index.html

Includes screenshots, traces, and step-by-step details for every test. Expires in 15 days.


All platforms - commit fef0bdf1910871e7f0743fdce34a3cecd362e52e - Run #1060

@kevinushey
kevinushey deployed to e2e-playwright September 17, 2026 03:43 — with GitHub Actions Active
@kevinushey
kevinushey deployed to e2e-playwright September 17, 2026 03:43 — with GitHub Actions Active
@kevinushey
kevinushey deployed to e2e-playwright September 17, 2026 03:45 — with GitHub Actions Active
@kevinushey
kevinushey deployed to e2e-playwright September 17, 2026 03:45 — with GitHub Actions Active
@kevinushey
kevinushey deployed to e2e-playwright September 17, 2026 03:45 — with GitHub Actions Active
@kevinushey
kevinushey deployed to e2e-playwright September 17, 2026 03:45 — with GitHub Actions Active
@kevinushey
kevinushey merged commit e122f81 into main Sep 17, 2026
18 of 23 checks passed
@kevinushey
kevinushey deleted the bugfix/console-r-version-unknown branch September 17, 2026 03:46
@kevinushey
kevinushey deployed to e2e-playwright September 17, 2026 03:53 — with GitHub Actions Active
@kevinushey
kevinushey deployed to e2e-playwright September 17, 2026 03:53 — with GitHub Actions Active
@kevinushey
kevinushey deployed to e2e-playwright September 17, 2026 03:53 — with GitHub Actions Active
@kevinushey
kevinushey deployed to e2e-playwright September 17, 2026 03:53 — with GitHub Actions Active
@kevinushey
kevinushey deployed to e2e-playwright September 17, 2026 03:53 — with GitHub Actions Active
@kevinushey
kevinushey deployed to e2e-playwright September 17, 2026 03:53 — with GitHub Actions Active
kevinushey added a commit that referenced this pull request Sep 18, 2026
* wait for a slow restart to answer before giving up on it

SessionOpener.sendPing ticked every 200ms and spent one of its 50 retries
on every tick, including ticks where a ping was already in flight and
nothing was sent. The budget was therefore ~10.2s of wall clock however
many pings were actually attempted, and when it ran out the loop marked
itself completed -- so the ping that did answer a moment later was
discarded by the completed_ guard and ConsoleRestartRCompletedEvent never
fired. A ping can stay unanswered for much longer than that: rserver
holds an RPC aimed at a session it is still relaunching, and the new
session then has to restore the workspace before it services RPCs.

A failed ping ended the wait outright too, so the retry that would have
reached the new session was never sent. That half dates to #17906, which
made onCompleted fire exactly once but also made the first failure
terminal, leaving maxRetries unused.

Budget the wait in wall-clock time instead (60s), wait for an outstanding
ping rather than spending the budget on ticks that send nothing, retry
after a failure, and announce the restart whenever a ping answers -- even
if the wait already timed out, since an answer means R really is back.
onCompleted still runs exactly once.

Without the event, Shell leaves the console unfocused with a stale prompt
and the Console pane keeps showing the previous R version. The e2e test
added in #18858 hit this on Server, where a restart takes 9-11s; it no
longer needs to hold the completion ping to keep the event alive.

Addresses #18870.

* bound how late a timed-out restart ping may announce

A ping that answers after the timeout still announces the restart, but
only within a 5s grace period: announcing refocuses the console, which
would otherwise pull the user away arbitrarily late.

Also drop the restartAnnounced_ guard, which one-ping-at-a-time already
made unreachable.

Addresses #18870.

This branch was successfully deployed

1 active deployment
e2e-playwright — fef0bdf1 Deployed Sep 17, 2026 by kevinushey via windows / e2e-desktop-windows (2) #1060
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Console pane shows (unknown) for the R version while the session is starting

1 participant