fix: entity graph gaps, ANNOTATE_ALL on transcription blocks, CSRF on client fetch #648

Merged
marcel merged 14 commits from worktree-feat+issue-286-notification-bell-form-actions into main 2026-05-20 20:36:16 +02:00
3 changed files with 20 additions and 3 deletions
Showing only changes of commit 392097287c - Show all commits

View File

@@ -81,8 +81,8 @@ function href(n: NotificationItem): string {
return async ({ result, update }) => {
if (result.type === 'failure' || result.type === 'error') {
errorMessage = m.notification_error_generic();
await update({ reset: false, invalidateAll: false });
}
await update({ reset: false, invalidateAll: false });
};
}}
>
@@ -129,8 +129,8 @@ function href(n: NotificationItem): string {
return async ({ result, update }) => {
if (result.type === 'failure' || result.type === 'error') {
errorMessage = m.notification_error_generic();
await update({ reset: false, invalidateAll: false });
}
await update({ reset: false, invalidateAll: false });
};
}}
>

View File

@@ -234,6 +234,23 @@ describe('NotificationDropdown', () => {
expect(optimisticMarkAllRead).toHaveBeenCalledOnce();
});
it('shows a role=alert error banner when mark-all-read returns a failure', async () => {
mockFormResult.type = 'failure';
render(NotificationDropdown, {
props: {
notifications: [makeNotification()],
optimisticMarkRead: () => {},
optimisticMarkAllRead: () => {},
onClose: () => {}
}
});
await page.getByRole('button', { name: /alle gelesen/i }).click();
const alert = document.querySelector('[role="alert"]');
expect(alert).not.toBeNull();
});
it('calls onClose when the view-all button is clicked', async () => {
const onClose = vi.fn();
render(NotificationDropdown, {

View File

@@ -73,7 +73,7 @@ export const actions = {
const data = await request.formData();
const raw = data.get('notificationId');
const notificationId = typeof raw === 'string' ? raw : null;
if (!notificationId) return fail(400, { error: null });
if (!notificationId) return fail(400, { error: getErrorMessage(undefined) });
const api = createApiClient(fetch);
const result = await api.PATCH('/api/notifications/{id}/read', {
params: { path: { id: notificationId } }