mirror of
https://github.com/J3vb/OwnCord.git
synced 2026-09-03 03:50:00 +03:00
An InvalidateUser/InvalidateChannel/InvalidateAll landing between getOrPopulate's DB read and its cache store was silently overwritten by the stale snapshot, serving revoked permissions for up to permCacheTTL (30s). Guard the cache write with a generation counter bumped by every invalidation; a populate that lost the race returns its snapshot for the current request but caches nothing (security scan 2026-07-22, F6). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>