This commit is contained in:
binwiederhier
2026-01-06 14:22:55 -05:00
parent f51e99dc80
commit 2856793eff
6 changed files with 74 additions and 10 deletions

View File

@@ -175,6 +175,7 @@ class SubscriptionManager {
}
// Collapse notification updates based on sids, keeping only the latest version
// Filters out notifications where the latest in the sequence is deleted
groupNotificationsBySID(notifications) {
const latestBySid = {};
notifications.forEach((notification) => {
@@ -184,7 +185,8 @@ class SubscriptionManager {
latestBySid[key] = notification;
}
});
return Object.values(latestBySid);
// Filter out notifications where the latest is deleted
return Object.values(latestBySid).filter((n) => !n.deleted);
}
/** Adds notification, or returns false if it already exists */

View File

@@ -18,6 +18,13 @@ const createDatabase = (username) => {
prefs: "&key",
});
db.version(5).stores({
subscriptions: "&id,baseUrl,[baseUrl+mutedUntil]",
notifications: "&id,sid,subscriptionId,time,new,deleted,[subscriptionId+new]", // added deleted index
users: "&baseUrl,username",
prefs: "&key",
});
return db;
};