fix failing test for notification deletion

This commit is contained in:
2025-03-27 11:40:32 -07:00
parent 9c22e154be
commit 75a4e133ed

View File

@@ -107,6 +107,12 @@ export class InMemoryNotificationRepository implements NotificationRepository {
const secondsThreshold = this.deviceIdsToDeliverTo[tupleKey.toString()][deviceId]; const secondsThreshold = this.deviceIdsToDeliverTo[tupleKey.toString()][deviceId];
delete this.deviceIdsToDeliverTo[tupleKey.toString()][deviceId]; delete this.deviceIdsToDeliverTo[tupleKey.toString()][deviceId];
if (Object.keys(this.deviceIdsToDeliverTo[tupleKey.toString()]).length === 0) {
// no more device IDs remaining for this key combination
delete this.deviceIdsToDeliverTo[tupleKey.toString()];
}
this.listeners.forEach((listener) => { this.listeners.forEach((listener) => {
const event: NotificationEvent = { const event: NotificationEvent = {
event: 'delete', event: 'delete',