Repository navigation
fix(desktop): stop blocking the renderer during topology polling - #19300
daniyal-sh wants to merge 1 commit into
Conversation
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a focused desktop performance fix that moves recurring topology polling off synchronous renderer-blocking IPC while preserving startup behavior, failure handling, snapshot identity, and older-bridge compatibility. The implementation is localized, additive at the contract boundary, and covered by targeted tests. You can add or adjust custom eligibility rules. Learn more. |
|
Thanks @daniyal-sh — I built on this in #19511. Your commit is cherry-picked unchanged as the first commit, and a second commit makes the desktop push topology changes into your preload cache, so the renderer no longer polls the main process at all (it also fixes the trace flooding in #19505). That made the async |
Problem
Periodic desktop topology reads call
ipcRenderer.sendSync. A busy main process therefore blocks the renderer and keystroke painting even when the topology handler itself is fast. Maintainer-triaged #12689 documents a roughly one-second wait in the synchronous bootstrap read while the browser client remains smooth.Change
Keep a cached preload snapshot for synchronous startup consumers and refresh it through asynchronous
invokeduring topology polling. Concurrent refreshes share one request. Failed refreshes preserve the last successful topology; authoritative empty results still remove stopped backends, and unchanged topology retains array identity. Cache the local-environment-enabled flag, which changes through relaunch.The optional bridge method, main-process handler, preload, and web connection reader are needed for the same desktop IPC fix. Older bridges retain their fallback. The web/mobile connection protocols and visual layout are unchanged.
Scope and approval
Addresses #12689 in the direction requested by maintainer triage: async invoke plus a last-known snapshot. That triage establishes the bug and intended behavior; it is not a claim of merge approval. The earlier #12698 is closed and unmerged. This implementation retains synchronous startup compatibility and targets recurring reads.
Verification
Post-rebase validation on this branch at
8b460a3c(Effect 4.0.4): 42 focused tests passed, one existing platform skip.vp run --filter @t3tools/desktop --filter @t3tools/web --filter @t3tools/contracts typecheck, changed-file lint/format, and patch whitespace checks passed. The native capture above bundles the actual before/after preloads from these rebased sources. Production server/web/desktop bundles and the sandboxed preload verifier also passed on the original benchmark checkout with these fixes, before upstream's dependency upgrade.Implemented and validated using GPT-6.1 Sol in T3 Code through the Codex harness.