fix(ci): parse errors, two leaky tests and the lint ratchets after the parity round

This commit is contained in:
Maurice
2026-10-22 12:44:07 +02:00
parent 8365d77c1d
commit 18b8e4af61
22 changed files with 127 additions and 86 deletions
+7 -10
View File
@@ -74,6 +74,11 @@ const PAGE_SIZE = 20
// Newest reset wins: a slower, older response must not overwrite the list of a filter the user has left.
let fetchSeq = 0
/** What marking everything read leaves, here or in another tab: every notification read, none to count. */
function allRead(state: NotificationState): Partial<NotificationState> {
return { notifications: state.notifications.map(n => n.is_read ? n : { ...n, is_read: true }), unreadCount: 0 }
}
export const useInAppNotificationStore = create<NotificationState>((set, get) => ({
notifications: [],
unreadCount: 0,
@@ -148,10 +153,7 @@ export const useInAppNotificationStore = create<NotificationState>((set, get) =>
markAllRead: async () => {
try {
await inAppNotificationsApi.markAllRead()
set(state => ({
notifications: state.notifications.map(n => ({ ...n, is_read: true })),
unreadCount: 0,
}))
set(allRead)
} catch {
// best-effort
}
@@ -224,10 +226,5 @@ export const useInAppNotificationStore = create<NotificationState>((set, get) =>
},
// Everything marked read at once elsewhere: the same end state markAllRead leaves.
handleAllRead: () => {
set(state => ({
notifications: state.notifications.map(n => n.is_read ? n : { ...n, is_read: true }),
unreadCount: 0,
}))
},
handleAllRead: () => set(allRead),
}))