Skip to content

fix: a slow client's web extension, and a new default editor - #142

Merged
BartvHelvert merged 2 commits into
masterfrom
fix/ci-flakes-worker-host-and-default
Nov 9, 2026
Merged

BartvHelvert merged 2 commits into
masterfrom
fix/ci-flakes-worker-host-and-default

Conversation

@BartvHelvert

Copy link
Copy Markdown
Owner

What this changes

Two flakes found while going through the 20 CI runs of #135's patch (ci-flake/escape-01..10 on
2546db3 and cc073d0, plus the PR's own runs). Each failed once there, each is a real bug a
user can hit, and neither is the Escape flake those runs were launched for.

fix(exthost), #140. HostedWorkerHosts.Host.open gave a web worker extension host 30
seconds to be claimed, counted from the moment the backend wanted it. The client that runs the
host is a second IDE process; when it is still starting, the backend fails the host before the
client has been offered it, and the extension's activation fails for good. In
run 42520379312
the backend gave up at 21:00:59 while the client registered its custom editors at 21:01:00 — one
second later — and the client's log holds no CodeBridgeWorkerHostsActivity line at all.

The seconds are now counted from the first client listening for hosts. So that the one case the
deadline exists for still reaches it, CodeBridgeWorkerHostsActivity listens even when
JBCefApp.isSupported() is false, rather than returning; it just runs nothing, and says why once.

fix(webview), #141. The client keeps its own copy of the custom-editor setup and decides
from it which editor a file opens in. Set Default sent the association to the backend and left
that copy alone until the backend's setup came back. In
run 42520388173
the file was reopened 641 ms before the backend re-typed it and 2.1 s before the client heard the
new association, so it went back into the custom editor and stayed there. The client now holds the
association as soon as the backend has taken it; the setup that arrives afterwards says the same.

734184d already did the matching thing on the backend for #133. This is the client's half.

What this does not change

The notebook Escape flake (#113) is untouched. #135's tracing ruled out all three of its
hypotheses and the drag added in cc073d0: across all five failures the client logs no
pressed ESCAPE in IdeKeyEventDispatcher, no Dragging cell, no Escape in cell, and
popup active=false; the backend logs no Escape either, and the thread dump taken during the
stall has the EDT parked in getNextEvent. The keystroke reaches neither process. Findings are on
#113; it needs a different experiment, not a fix here.

SplitModeActionsTest > rename formatting and quick fixes… also failed twice in those runs. It is
#136, fixed on master by 3f721a1 and e908d3e, which both batches predate.

How it was tested

  • :backend:compileKotlin, :webview.frontend:compileKotlin and :backend:compileTestKotlin all
    pass.
  • HostedWorkerHostsTest passes, all four tests including the new one, run through the JUnit
    platform launcher against the module's test classpath.
  • Gradle's :backend:test could not be run on this machine: the IntelliJ platform plugin probes
    the downloaded JBR, which NixOS cannot execute (exit value 127). The tests needing
    CodeInsightTestFixture were not run for the same reason. Neither fix has a UI test; both are
    covered by the existing SplitModeWebExtensionTest and SplitModeCustomEditorTest scenarios
    that found them, so CI exercises them.

Checklist

  • Nothing is special-cased for one extension.
  • A new feature has a UI test. Two bug fixes, both under existing UI test scenarios.
  • No internal, override-only, obsolete or deprecated platform API.
  • docs/ is updated where behaviour changed, docs/status.md especially. No change to
    what is supported; both are timing fixes.
  • Third-party material keeps its notice and is listed in NOTICE.md. None added.

A web worker extension host was given 30 seconds to be claimed from the
moment the backend wanted it. In split mode the client that runs it is a
second IDE process: on a loaded machine it can still be starting then,
and the host was failed before it was ever offered one. Activation of
the extension fails for good, so a web extension is dead for the
session.

Count those seconds from the first client listening for hosts instead.
The client now listens even without the browser that runs them, so the
one case the deadline is for -- no JCEF -- still reaches it, and says so.

Refs #140
Set Default sent the association to the backend and left the client's
own copy of the setup alone until the backend's changed setup arrived.
The client decides from that copy which editor a file opens in, so a
file opened in between -- 2.1 seconds on a slow runner -- opened in the
editor the user had just stopped choosing.

Hold the association as soon as the backend has taken it. The setup
that arrives afterwards says the same.

Refs #141
@BartvHelvert
BartvHelvert merged commit 306e178 into master Nov 9, 2026
8 checks passed
@BartvHelvert
BartvHelvert deleted the fix/ci-flakes-worker-host-and-default branch November 9, 2026 21:46
@BartvHelvert

Copy link
Copy Markdown
Owner Author

Correction, after this was merged: the fix(webview) half (306e178) narrows #141 rather than closing it, and the description above overstates it.

It reproduced again on ci-flake/escape-04 (run 42692783765). In that failure and in the original, the backend's own File types changed — logged from inside CustomEditorDefaults.apply, which setDefault calls before returning — lands after the test's reopen (402 ms and 672 ms respectively). So setDefaultEditor had not returned either time, and the client update this PR added had nothing to act on yet. I read the client's 2.1-second lag and did not check that the backend's apply was also late.

The change is still worth having: it moves the client's knowledge from the changes() flow to the RPC's return, about 1.7 s earlier here. #141 is reopened with the full timelines and what is still needed. The fix(exthost) half (f8605da, #140) is unaffected.

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.

1 participant