Gnome toolbar for Tangled code review.

perf(helper): share repo and identity lookups that are already running #39

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

Fixes #36.

The helper's client now shares a repo lookup (getRepoByRepoDid, or the knot fallback) or an identity lookup (resolveMiniDoc) that is already running. Concurrent callers wait for the same answer, failure included, and a failed lookup isn't kept, so the next call asks again. When the hourly repo TTL runs out, a refresh asks once per repo instead of about once per waiting PR (8 instead of 19 an hour in the fetch log), and a cold start resolves each person once. This only removes requests. If another refresh's cancel cuts a shared lookup short, a refresh that is still running starts it again.

invalidateRepo drops a running repo lookup too. That lookup's answer is then not cached, because it may hold the old manifest. This adds one internal map of running lookups to the client's shared caches. It is not saved to cache.json. It adds no settings key, no protocol message, and no state. Unit tests count lookups under many concurrent callers, including failures, a cancelled refresh, and an invalidation. The protocol test now checks one repo lookup and three identity lookups for its three PRs.

🤖 Generated with Claude Code

Commits 0