Fixes stale cached data on account switch#5035
Conversation
Prevents cached data from a previous account from displaying after an account switch by incorporating a fingerprint of the active authentication session into cache ETags. This ensures that cached items tied to an integration or resource are re-fetched when the underlying account's access token changes, invalidating data specific to the old account. A 64-bit FNV-1a hash is introduced to generate robust session fingerprints. Also adds a `peek` method to the cache to safely retrieve resolved cached values without triggering a fetch. (#4943, #5035)
53e0386 to
d23d3eb
Compare
🤖 Augment PR SummarySummary: Prevents stale integration/resource cache entries from leaking across account switches by tying cache ETags to the active authentication session. Changes:
Technical Notes: The session fingerprint is derived from the current auth session access token, ensuring cache invalidation when the active session changes. 🤖 Was this summary useful? React with 👍 or 👎 |
There was a problem hiding this comment.
Pull request overview
This PR addresses stale integration/resource cache entries surfacing after switching accounts by incorporating an authentication-session fingerprint into cache ETags, forcing re-fetches when the active session changes.
Changes:
- Add a 64-bit FNV-1a hash helper (
fnv1aHash64) to generate stable session fingerprints. - Add
IntegrationBase.sessionFingerprintderived from the current session access token. - Update cache ETag construction for integration/resource caches, plus add a
peekhelper used for resource ETags. - Document the fix in
CHANGELOG.md.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/system/hash.ts |
Adds 64-bit FNV-1a hash to support session fingerprinting. |
src/plus/integrations/models/integration.ts |
Introduces sessionFingerprint based on the current auth session’s token. |
src/cache.ts |
Uses session fingerprint in cache ETags and adds peek to read resolved cached values. |
CHANGELOG.md |
Adds a “Fixed” entry for stale cached data after account switching. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Prevents cached data from a previous account from displaying after an account switch by incorporating a fingerprint of the active authentication session into cache ETags. This ensures that cached items tied to an integration or resource are re-fetched when the underlying account's access token changes, invalidating data specific to the old account. A 64-bit FNV-1a hash is introduced to generate robust session fingerprints. Also adds a `peek` method to the cache to safely retrieve resolved cached values without triggering a fetch. (#4943, #5035)
Introduces comprehensive tests for the 32-bit and 64-bit FNV-1a hash implementations. Validates both `fnv1aHash` and `fnv1aHash64` against official test vectors from RFC 9923, ensuring correctness and adherence to the standard. The tests also verify output format and collision resistance for varied inputs. This ensures the reliability and precision of the hash functions, particularly highlighting how the 64-bit implementation accurately matches RFC vectors by mitigating JavaScript's number precision limitations.
f4290f4 to
bd976be
Compare
Prevents cached data from a previous account from displaying after an account switch by incorporating a fingerprint of the active authentication session into cache ETags. This ensures that cached items tied to an integration or resource are re-fetched when the underlying account's access token changes, invalidating data specific to the old account. A 64-bit FNV-1a hash is introduced to generate robust session fingerprints. Also adds a `peek` method to the cache to safely retrieve resolved cached values without triggering a fetch. (#4943, #5035)
Introduces comprehensive tests for the 32-bit and 64-bit FNV-1a hash implementations. Validates both `fnv1aHash` and `fnv1aHash64` against official test vectors from RFC 9923, ensuring correctness and adherence to the standard. The tests also verify output format and collision resistance for varied inputs. This ensures the reliability and precision of the hash functions, particularly highlighting how the 64-bit implementation accurately matches RFC vectors by mitigating JavaScript's number precision limitations.
bd976be to
0845f51
Compare
Prevents cached data from a previous account from displaying after an account switch by incorporating a fingerprint of the active authentication session into cache ETags. This ensures that cached items tied to an integration or resource are re-fetched when the underlying account's access token changes, invalidating data specific to the old account. A 64-bit FNV-1a hash is introduced to generate robust session fingerprints. Also adds a `peek` method to the cache to safely retrieve resolved cached values without triggering a fetch. (#4943, #5035)
Introduces comprehensive tests for the 32-bit and 64-bit FNV-1a hash implementations. Validates both `fnv1aHash` and `fnv1aHash64` against official test vectors from RFC 9923, ensuring correctness and adherence to the standard. The tests also verify output format and collision resistance for varied inputs. This ensures the reliability and precision of the hash functions, particularly highlighting how the 64-bit implementation accurately matches RFC vectors by mitigating JavaScript's number precision limitations.
0845f51 to
463f058
Compare
Prevents cached data from a previous account from displaying after an account switch by incorporating a fingerprint of the active authentication session into cache ETags. This ensures that cached items tied to an integration or resource are re-fetched when the underlying account's access token changes, invalidating data specific to the old account. A 64-bit FNV-1a hash is introduced to generate robust session fingerprints. Also adds a `peek` method to the cache to safely retrieve resolved cached values without triggering a fetch. (#4943, #5035)
Introduces comprehensive tests for the 32-bit and 64-bit FNV-1a hash implementations. Validates both `fnv1aHash` and `fnv1aHash64` against official test vectors from RFC 9923, ensuring correctness and adherence to the standard. The tests also verify output format and collision resistance for varied inputs. This ensures the reliability and precision of the hash functions, particularly highlighting how the 64-bit implementation accurately matches RFC vectors by mitigating JavaScript's number precision limitations.
463f058 to
d502571
Compare
Prevents cached data from a previous account from displaying after an account switch by incorporating a fingerprint of the active authentication session into cache ETags. This ensures that cached items tied to an integration or resource are re-fetched when the underlying account's access token changes, invalidating data specific to the old account. A 64-bit FNV-1a hash is introduced to generate robust session fingerprints. Also adds a `peek` method to the cache to safely retrieve resolved cached values without triggering a fetch. (#4943, #5035)
Fixes: #4943
Prevents cached data from a previous account from displaying after an account switch by incorporating a fingerprint of the active authentication session into cache ETags.
This ensures that cached items tied to an integration or resource are re-fetched when the underlying account's access token changes, invalidating data specific to the old account. A 64-bit FNV-1a hash is introduced to generate robust session fingerprints.
Also adds a
peekmethod to the cache to safely retrieve resolved cached values without triggering a fetch.Checklist
Fixes $XXX -orCloses #XXX -prefix to auto-close the issue that your PR addresses