1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-24 12:06:15 +01:00
bitwarden-browser/libs
Matt Gibson fd85d13b18
Ps/avoid state emit until updated (#7198)
* Add a small default time to limit timing failures

* Handle subscription race conditions

* Add Symbols to tracked emission types

This is a bit of a cheat, but Symbols can't be cloned, so
we need to nudge them to something we can handle.
They are rare enough that anyone hitting this is likely to
expect some special handling.

* Ref count state listeners to minimize storage activity

* Ensure statuses are updated

* Remove notes

* Use `test` when gramatically more proper

* Copy race and subscription improvements to single user

* Simplify observer initialization

* Correct parameter names

* Simplify update promises

test we don't accidentally deadlock along the `getFromState` path

* Fix save mock

* WIP: most tests working

* Avoid infinite update loop

* Avoid potential deadlocks with awaiting assigned promises

We were awaiting a promise assigned in a thenable. It turns out that
assignment occurs before all thenables are concatenated, which can cause
deadlocks. Likely, these were not showing up in tests because we're
using very quick memory storage.

* Fix update deadlock test

* Add user update tests

* Assert no double emit for multiple observers

* Add use intent to method name

* Ensure new subscriptions receive only newest data

TODO: is this worth doing for active user state?

* Remove unnecessary design requirement

We don't need to await an executing update promise, we
can support two emissions as long as the observable is
guaranteed to get the new data.

* Cleanup await spam

* test cleanup option behavior

* Remove unnecessary typecast

* Throw over coerce for definition options

* Fix state$ observable durability on cleanup
2023-12-13 08:06:24 -05:00
..
.vscode Multi root workspace tweaks (#2858) 2022-06-13 21:39:36 -05:00
angular [PM-252] fix inconsistent generator configuration behavior (#6755) 2023-12-12 19:17:20 -05:00
auth [deps] Autofill: Update prettier to v3 (#7014) 2023-11-29 16:15:20 -05:00
common Ps/avoid state emit until updated (#7198) 2023-12-13 08:06:24 -05:00
components [CL-149] add stacked banner story (#7106) 2023-12-08 11:49:20 -05:00
exporter [PM-3565] Enforce higher minimum KDF (#6440) 2023-12-05 10:55:12 -05:00
importer Tools/pm 3567 import xxe detection (#6918) 2023-12-08 09:50:02 -05:00
node [deps] Autofill: Update prettier to v3 (#7014) 2023-11-29 16:15:20 -05:00
shared Add State Provider Framework (#6640) 2023-11-09 17:06:42 -05:00
tools [PM-4266] Create folder for tools owned features (#6761) 2023-11-02 14:10:28 +01:00
vault [deps] Autofill: Update prettier to v3 (#7014) 2023-11-29 16:15:20 -05:00