You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 59974c7
Browse filesBrowse the repository at this point in the historyBrowse files
fix: hold a fork back from the session list until its session/fork response is out (#642)
## Problem
`session/fork` calls `thread/fork` and then sets the session up.
Meanwhile `SessionListSubscriptions` gets `thread/started` of the fork
and sends `_session/list/changes` with it before the fork response. The
client meets an unknown session and lists it as a session of its own.
JetBrains Air then refuses the fork (IJAI-4105).
## Fix
- `SessionIndexService.forking(...)` wraps `forkSession` (v1, and v2
through it). A `setTimeout(0)` releases the rows after the SDK has
written the response.
- `SessionListSubscriptions` keeps the rows of a fork in `held` while
its fork is in flight:
- by `forkedFrom`;
- by the fork thread id once `thread/fork` answers (`forkCreated`). A
row of a `thread/list` scan has `forkedFromId: null`, so the id is
needed.
- `SessionForkOrigins.remember` records the parent of a fork that this
adapter made, so its rows carry `forkedFrom` without a rollout read.
## Tests
`holds the row of a fork back until the response of its session/fork is
out` (SessionListSubscriptions.test.ts). It fails without the fix. It
uses `path.resolve("/repo")` so that it also passes on Windows.
0 commit comments