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
fix(openscience): stamp queued usage with its account so a flush can't bill the wrong one (#130)
Queued usage rows carried no account identity, so flushPendingUsage sent
every row under whatever session was active at startup. If usage was queued
under account A (or while the session was transiently unreadable) and account
B later logged in, the flush billed B for A's usage. dropUsageQueue only runs
on explicit logout, not a silent account swap.
Stamp each queued row with a stable account tag (user_id, else a short hash of
the api_key — never the raw key). On flush, a row tagged for a DIFFERENT
account is kept in the queue rather than sent (it flushes when that account is
active); legacy/untagged rows stay best-effort. Pure shouldFlushForAccount
helper is unit-tested. (#14)
0 commit comments