Repository navigation
fix(web): sidebar rows no longer re-render when the server-config map is replaced - #40048
juliusmarminge wants to merge 2 commits into
Conversation
… is replaced useSupportsMultiplePullRequests and useSidebarLinkedIssueState subscribed to the whole server-config map for one boolean per environment, so every replacement of the map during startup re-rendered every sidebar row. They now read per-environment boolean atoms that only notify when the boolean changes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Thread transfer impact
This comment will update automatically after the next completed run. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
Findings from the agent that worked on #39934 before Julius took it over (my PR was #40049; this PR now supersedes it). Reproduced: on the web client, using the production build served from source with the issue's 300-thread seed. Headless Chromium on a Linux VM, base commit d984b71. Not Windows, so the Windows numbers in this PR's body are not reproduced here. Result on base: 600 Map-attributed row renders ( Timing: not claimed. Long-task medians were noisy on that VM: base 2144 ms and 3934 ms across two runs; with the change, 2519 ms and 1830 ms. I don't have a timing comparison I'd stand behind on that machine. Tests: Checks on 4810e3b: Not run: the integrated pass in T3's browser tools against the web client. Also, Posted by the agent working for Shivam, via T3 Code. |
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The useSupportsMultiplePullRequests change and its test mocks fix #39934, which #40048 covers with its own evidence. Keep this PR to the provider model comparison. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Each time the server config was refreshed while the app loaded, every sidebar thread row re-rendered, even when nothing a row shows had changed. At 300 threads on Windows that added hundreds of milliseconds of main-thread work per load. The rows now subscribe only to the one value per environment they use.
useSupportsMultiplePullRequestsreads a new per-environmentuseHasServerConfigatom instead of the whole server-config map.useSidebarLinkedIssueStatereads a new per-environmentuseSupportsIssuesatom.Atom.familyselectors overserverConfigsAtominapps/web/src/state/entities.ts. Rows still update when an environment gains or loses its config or its issues support.Fixes #39934
Reproduction on main
Commit f2ec853 (origin/main) on a pooled Windows Server 2025 machine. Steps:
vp i;cd apps/web && vp build; from apps/server startedT3CODE_DEV_SEED=0 node src/bin.ts serve --base-dir <home> --port 3799 --host 127.0.0.1 --dev-url http://localhost:5733; ran the issue's seed.cjs with10 30 4(DONE 300); restarted the server on the same home without --dev-url (production web); minted a pairing URL withnode src/bin.ts pair --ttl 2h; ran the issue's probe.cjs unchanged for 16 loads. Main: 300 rows in every load; in 13/16 loads the rows got 600 extra renders attributed tohook59:Map(1)(the server-config map), median row renders 2113. Long-task total median over all loads 3965 ms (2599-4320); affected loads median 4041 ms (3685-4320); unaffected loads 2599/2664/2954 ms. Comparison on the same machine, seed and home: scratch build where useSupportsMultiplePullRequests and useSidebarLinkedIssueState read per-environment boolean atoms (Atom.family over serverConfigsAtom), 16 loads: Map(1)-attributed renders 0 in every load, median row renders 1513; long-task median over all loads 3298.5 ms (2423-3582); affected loads (13/16, still showing the separate 600 provider-entry renders) median 3301 ms (3193-3582). That is about 740 ms saved per affected load. Logs: https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/efd5195910e366b3/main-utf8.log (main), https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/f633091dd4385c98/fix-utf8.log (scratch), scratch patch https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/45fbe051ac3d3451/scratch-fix.diffEvidence
Being captured: before and after in the real app. This section is filled in before the pull request can merge.
Tests
vp run check:changed: format, lint, knip, typecheck (2 packages), test (1 file) and react compiler (3 files) all pass.node probe.cjsfrom the issue, 16 loads on main and 16 on the fix, on Windows Server 2025 with a 300-thread seed: Map-caused row renders went from 600-900 (7/16 loads) to 0 (16/16), and the affected-load long-task median from 3483 ms to 3233.5 ms.Not in this change
providerEntryByInstanceIdrow renders during startup remain; the issue says they are filed separately.useServerConfigs()for one field; they are not per-row, so they were left alone.Who did the work
Run by the t3code factory in T3 Code.