1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-22 19:23:52 +00:00

[PM-10381] Fix waiting for last sync - Browser Refresh (#10438)

* [PM-10381] Add activeUserLastSync$ to SyncService

* [PM-10381] Introduce waitUtil operator

* [PM-10381] Use new activeUserLastSync$ observable to wait until a sync completes before attempting to get decrypted ciphers

* [PM-10381] Fix failing test

---------

Co-authored-by: bnagawiecki <107435978+bnagawiecki@users.noreply.github.com>
This commit is contained in:
Shane Melton
2024-08-21 14:54:09 -07:00
committed by GitHub
parent bbe64f4ae6
commit a8edce2cc1
5 changed files with 63 additions and 5 deletions

View File

@@ -34,6 +34,12 @@ export abstract class SyncService {
*/
abstract lastSync$(userId: UserId): Observable<Date | null>;
/**
* Retrieves a stream of the currently active user's last sync date.
* Or null if there is no current active user or the active user has not synced before.
*/
abstract activeUserLastSync$(): Observable<Date | null>;
/**
* Optionally does a full sync operation including going to the server to gather the source
* of truth and set that data to state.