Gnome toolbar for Tangled code review.

perf(helper): spread the poll's re-lists over its interval while Jetstream is live #43

Merged permadeath.com
targeting main from azurite-frogmouth.test.pds.did.bot/gnome-shell-extension-tangled-reviewer:claude/stagger-lists
Merged opened by and assigned to permadeath.com
targeting main from azurite-frogmouth.test.pds.did.bot/gnome-shell-extension-tangled-reviewer:claude/stagger-lists

While Jetstream is live, the scheduled refresh no longer re-lists every watched repo and account at once. Each list (a repo's open PRs, an account's repos or collaborations) now has its own turn within the poll interval, placed by a hash of its key. The poll runs after a fifth of the interval (3 minutes by default) with no other refresh, and asks only for the lists whose turn has come. Event-driven refreshes pick up any list that's due too. So each list is still asked again once per interval, a few at a time.

In the live helper's fetch log, every full refresh sent a burst of 26 requests in about 6 seconds: 22 listPulls, 2 listRepos and 2 listCollaboratorsBy. That ran at ~270 requests a minute against Bobbin's ~300 per IP, which is shared with anything else on the machine. With the user's 10 cached repos, the turns fall at 0.1, 5.6, 9.2, 9.7, 9.9, 11.9, 11.9, 12.7, 14.2 and 14.6 minutes. When Jetstream is offline, the poll still asks for everything once per interval, because no events say what changed. A manual refresh, a config change and a reconnect do the same.

🤖 Generated with Claude Code

Commits 0