1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-22 03:03:43 +00:00

[PM-8292] Fixup ForegroundSyncService (#9292)

* Change `object` to `Record<string, unknown>`

* Change `object` to `Record<string, unknown>` Pt. 2

* Update ForegroundSyncService

- Manage finish message in the listener to more gaurantee a message back
- Make the timeout much longer
- Allow it to throw if the background sync service threw

---------

Co-authored-by: Cesar Gonzalez <cesar.a.gonzalezcs@gmail.com>
This commit is contained in:
Justin Baur
2024-05-29 12:12:58 -04:00
committed by GitHub
parent beb930902a
commit a6df923416
23 changed files with 328 additions and 86 deletions

View File

@@ -1,7 +1,7 @@
import { Subscription } from "rxjs";
import { BroadcasterService, MessageBase } from "../abstractions/broadcaster.service";
import { MessageListener, MessageSender } from "../messaging";
import { MessageListener } from "../messaging";
/**
* Temporary implementation that just delegates to the message sender and message listener
@@ -10,14 +10,7 @@ import { MessageListener, MessageSender } from "../messaging";
export class DefaultBroadcasterService implements BroadcasterService {
subscriptions = new Map<string, Subscription>();
constructor(
private readonly messageSender: MessageSender,
private readonly messageListener: MessageListener,
) {}
send(message: MessageBase, id?: string) {
this.messageSender.send(message?.command, message);
}
constructor(private readonly messageListener: MessageListener) {}
subscribe(id: string, messageCallback: (message: MessageBase) => void) {
this.subscriptions.set(