1
0
mirror of https://github.com/bitwarden/browser.git synced 2025-03-31 17:46:00 +02:00
bitwarden-browser/libs/common
Addison Beck 55e4b5ee09
fix: Use WeakMap in DerivedStateProvider to separate user state caches ()
Bug fix for PM-15914 where switching users would incorrectly share cached
derived states. The `DerivedStateProvider` now uses a `WeakMap` to maintain
separate caches for each user's state `Observable`.

- Modifies `DefaultDerivedStateProvider` to use `WeakMap` for caching
- Each user's state `Observable` gets its own definition cache
- Added test to verify correct behavior during user switching
- Allows proper garbage collection of unused state caches

This fixes issues where:
- Users would see other users' cached states after switching accounts
- Derived states weren't properly isolated between users
- Cache keys didn't distinguish between different user states
2025-01-15 11:41:44 +01:00
..
spec Typescript-strict-plugin () 2024-12-09 20:58:50 +01:00
src fix: Use WeakMap in DerivedStateProvider to separate user state caches () 2025-01-15 11:41:44 +01:00
custom-matchers.d.ts [PM-8847] Delay browser local storage operations during reseed () 2024-07-19 16:12:29 -04:00
jest.config.js [PM-16872] Update libs to use explicit dependencies () 2025-01-10 11:21:38 +01:00
package.json chore(deps): update dependency rimraf to v5 () 2023-05-19 14:23:44 +02:00
test.setup.ts [PM-8847] Delay browser local storage operations during reseed () 2024-07-19 16:12:29 -04:00
tsconfig.json [PM-17029] Convert libs/common to relative imports () 2025-01-14 10:11:37 -05:00
tsconfig.spec.json [EC-423] Fix unit tests () 2022-08-11 11:35:08 +10:00