Skip to content

Fix stale source column activation - #18737

Merged
kevinushey merged 2 commits into
mainfrom
bugfix/18736-source-column-activation
Sep 8, 2026
Merged

kevinushey merged 2 commits into
mainfrom
bugfix/18736-source-column-activation

Conversation

@kevinushey

Copy link
Copy Markdown
Collaborator

Intent

Prevent delayed document-outline initialization from switching back to a deselected Source column or reviving a column that has been closed. A revived column can become the destination for a new document and trigger a null activeEditor_ dereference during tab activation.

Closes #18736.

Approach

  • Keep outline initialization local to its widget instead of calling setActive(column_).
  • Reject unregistered columns in object-based activation and active-column lookup.
  • Ignore selection events from removed columns, retain the selected editor across callbacks, and verify it is still active before announcing it or giving it deferred focus.

The checks preserve activation semantics as well as preventing the exception: retaining only a local editor reference could announce an orphaned document after the active column has changed.

Automated Tests

Added two Playwright regressions that hold the 100 ms initialization timers until after selecting another column or closing the original column. Both fail against the unmodified build; the closure case reproduces the reported getPath() exception and timer → activation → selection stack. Both pass with the fix.

Validation passed:

  • GWT draft build (ant -Dgwt.local.workers=4 -Dgwt.xmx=-Xmx4G draft).
  • Playwright TypeScript check (tsc --noEmit).
  • 16 E2E tests covering the new regressions, active-tab restoration, close/open races, document-focus RPCs, ordinary editing, and Files date-format preferences.

E2E validation used macOS Server with R 4.6.1, isolated session configuration, and an existing local C++ build. Desktop was not separately rerun.

QA Notes

Open a document in an additional Source column, then switch back to the main column before outline initialization completes. The selected document should remain active. Close the added column and create a new R document: it should appear in the main Source pane, accept editing commands, and produce no client exception. The added tests control timer ordering to exercise these cases deterministically.

Documentation

Added a bug-fix entry to NEWS.md.

Checklist

  • If this PR adds a new feature, or fixes a bug in a previously released version, it includes an entry in NEWS.md
  • If this PR adds or changes UI, the updated UI meets accessibility standards (no visual UI changes)
  • A reviewer is assigned to this PR
  • This PR passes all local unit tests (focused E2E tests, build, and typecheck passed; full unit suite not run)

@gtritchie gtritchie left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@github-actions

github-actions Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

RStudio E2E - all platforms

All tests passed!

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

Passed Failed Skipped Flaky
2594 0 184 5
Platform ✅ Passed ❌ Failed ⚠️ Skipped 🔁 Flaky
✅ auth-teardown 2 0 10 0
✅ desktop-linux 652 0 38 1
✅ desktop-macos 658 0 33 1
✅ desktop-windows 655 0 39 3
✅ server-linux 599 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 2298ab89bd80776e63d7380eda2280d6da0acea4 - Run #874

@kevinushey
kevinushey merged commit a3e8492 into main Sep 8, 2026
1 of 5 checks passed
@kevinushey
kevinushey deleted the bugfix/18736-source-column-activation branch September 8, 2026 23:38

This branch was previously deployed

1 inactive deployment
e2e-playwright — 2298ab89 Deployed Sep 9, 2026 by kevinushey via windows / e2e-desktop-windows (3) #874
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.

SourceColumn.onSelection can dereference a null activeEditor_ during re-entrant tab activation

2 participants