You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TtlCache.invalidate() is lost if it lands while a load is in flight — stale platform summary is re-cached for a full TTL #463
src/analytics/ttl-cache.ts backs AnalyticsService.platformSummary(), which is busted by ANALYTICS_PLATFORM_INVALIDATE_EVENT on bounty create/pay and first repository sync:
invalidate() only clears entry. It doesn't know about a load that's already running. The sequence:
A request misses the cache and starts loadPlatformSummary(): three queries, counting bounties that don't yet include the new one.
BountiesService.create() or markMergedAndRelease() commits and emits the invalidate event, so entry = null, a no-op.
The in-flight loader resolves with the pre-change counts and writes them into entry with a fresh TTL.
For the next ANALYTICS_PLATFORM_SUMMARY_TTL_MS (60s by default), every homepage request gets the stale totalBounties / totalPaidOut. The invalidation was lost. Concurrent callers joined to the stale inflight promise after the invalidate get the stale value too.
README.md documents that multi-instance deploys can serve a TTL of staleness per process. This is different: it happens within a single process, exactly in the busy periods when invalidation matters most.
Suggested fix
Version the cache so a load that started before an invalidate can't populate it:
privategeneration=0;invalidate(){this.entry=null;this.inflight=null;this.generation++;}// in the loader:constgen=this.generation;constdata=awaitloader();if(gen===this.generation)this.entry={ data,expiresAt: Date.now()+this.ttlMs};
Also clear inflight on invalidate so callers after the invalidate start a fresh load. Add a unit test: start a load, call invalidate(), resolve the load, and the next getOrLoad calls the loader again.
@iamcracked-dev has applied to work on this issue as part of the Stellar Wave Program's 9th wave.
I’d love to help out with this issue. I’ve checked the current codebase/documentation and know exactly what needs to be updated to make this clearer. I will ensure everything aligns perfectly with your existing contribution guidelines.
Congratulations, @iamcracked-dev! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on September 30, 2026.
🧑💻 @iamcracked-dev: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.
Warning
When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.
🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.
😎 @iamcracked-dev: You earned 100 Points for completing this issue! After the current Wave ends, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here. You can also Leave a review to share your experience working on this issue.
🧑💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.
Activity
Halimatyemisi commentedon Sep 27, 2026
@Halimatyemisi has applied to work on this issue as part of the Stellar Wave Program's 9th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @Halimatyemisi to this issue.
Proxima84-code commentedon Sep 27, 2026
I have submitted a clean, tested fix resolving this race condition in PR #465 (#465).
ttl-cache.spec.tsensuring discarded stale loaders do not repopulate the cache.iamcracked-dev commentedon Sep 27, 2026
@iamcracked-dev has applied to work on this issue as part of the Stellar Wave Program's 9th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @iamcracked-dev to this issue.
drips-wave commentedon Sep 27, 2026
Congratulations, @iamcracked-dev! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on September 30, 2026.
🧑💻 @iamcracked-dev: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.
Warning
When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.
🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.
🌊 Happy Wave 🌊
drips-wave commentedon Sep 27, 2026
This issue has been completed by @iamcracked-dev as part of the Stellar Wave Program's 9th Wave 🥳
😎 @iamcracked-dev: You earned 100 Points for completing this issue! After the current Wave ends, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here. You can also Leave a review to share your experience working on this issue.
🧑💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.