Commit 033fcdf
fix: re-trigger lineage render on
When the lineage webview first mounts, the extension posts an initial
`render` from `init()` before the React `window.addEventListener('message', ...)`
in `LineageView.tsx` has been registered. VS Code's webview API queues
postMessages until the iframe's HTML is ready, not until React's effects
have run, so the initial render can be silently dropped.
The webview already attempts a recovery via `executeRequestInAsync('init', {})`
once its listener is registered, and PR #1857 added an `eventMapChanged`
re-render path. Both close *some* races, but neither covers the case where
the recovery `init` is delayed past where the user perceives the panel as
broken (a known telemetry signal: `Lineage:getStartingNode` "No event found"
fires 811 times across 84 distinct machines in the last 7 days, with the
top offender hitting it 93 times in a 35-minute single session).
This adds an explicit `onWebviewReady` override on `NewLineagePanel` that
re-runs `renderStartingNode()` once the framework-level `webview:ready`
ack arrives. By that point both `useListeners` (AppProvider) and
`LineageView`'s own message listener have registered, so the second
render lands. The webview-driven `init` recovery and the manifest-change
re-render remain in place as additional belts.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>webview:ready to close postMessage race (#1931)1 parent e17edf5 commit 033fcdf
1 file changed
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
95 | 100 | | |
96 | 101 | | |
97 | 102 | | |
| |||
0 commit comments