Add tests, fix firebase

This commit is contained in:
binwiederhier
2026-01-13 20:50:31 -05:00
parent a3c16d81f8
commit 44f20f6b4c
6 changed files with 229 additions and 9 deletions

View File

@@ -202,9 +202,10 @@ class SubscriptionManager {
/** Adds/replaces notifications, will not throw if they exist */
async addNotifications(subscriptionId, notifications) {
const notificationsWithSubscriptionId = notifications.map((notification) => {
return { ...messageWithSequenceId(notification), subscriptionId };
});
const notificationsWithSubscriptionId = notifications.map((notification) => ({
...messageWithSequenceId(notification),
subscriptionId,
}));
const lastNotificationId = notifications.at(-1).id;
await this.db.notifications.bulkPut(notificationsWithSubscriptionId);
await this.db.subscriptions.update(subscriptionId, {