stagger initial scheduler ticks to avoid rebuild storm
test / unit + widget + golden + a11y (push) Failing after 33s
test / integration_test (xvfb) (push) Has been skipped
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped

Firing all tier ticks simultaneously on project open causes multiple
IPC calls (pql, git, files) to run in parallel, their responses
triggering rapid setState rebuilds that beachball the merged thread.
Stagger 500ms apart so each panel refreshes sequentially.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jeroen Schweitzer
2026-05-01 11:41:42 +02:00
co-authored by Claude Opus 4.6
parent 2f7435f271
commit 0485a36091
2 changed files with 7 additions and 3 deletions
+6 -2
View File
@@ -50,10 +50,14 @@ class SchedulerService {
void _startTicker() {
_stopTicker();
// Immediate first tick for all tiers.
// Stagger the initial ticks to avoid a rebuild storm on project open.
var delay = 0;
for (final tier in SchedulerTier.values) {
if (tier == SchedulerTier.midnight) continue;
_events.emit(SchedulerTick(tier: tier));
Timer(Duration(milliseconds: delay), () {
_events.emit(SchedulerTick(tier: tier));
});
delay += 500;
}
// Then start the periodic isolate.