Skip to content

refactor!: markNotificationAsRead takes notification_id + kind#37

Merged
aeharding merged 1 commit into
mainfrom
mark-notification-read-by-id
May 23, 2026
Merged

refactor!: markNotificationAsRead takes notification_id + kind#37
aeharding merged 1 commit into
mainfrom
mark-notification-read-by-id

Conversation

@aeharding
Copy link
Copy Markdown
Owner

Summary

The current markNotificationAsRead({ notification, read }) signature forces callers to hand in a full Notification object even though every provider only consumes kind and id. Callers who only know "I want to mark PM #42 read" have to fabricate a Notification with bogus creator_id, published_at, etc. just to satisfy the type.

Change the signature to the honest minimum:

markNotificationAsRead({ kind: NotificationDataType; notification_id: number; read: boolean })

All three providers' implementations only touch those two fields, so it's a pure simplification — no behavior change.

Test plan

  • pnpm test:types clean
  • pnpm test — 19 / 19 pass
  • pnpm format:check clean

Breaking

Consumers using client.markNotificationAsRead({ notification, read }) need to switch to { kind: notification.kind, notification_id: notification.id, read }. (Voyager PR follow-up.)

@aeharding aeharding merged commit 6dcb035 into main May 23, 2026
1 check passed
@aeharding aeharding deleted the mark-notification-read-by-id branch May 23, 2026 04:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant