Commit Graph
7 Commits
Author SHA1 Message Date
Harsh Singh ebb9b27400 fix: API notification add and edit answer 400 for a non-object Notification and no 500 for a nested Token (#8429) 2026-11-27 08:44:04 -05:00
Jash Ambaliya 9d203ecf25 fix: notification and user preference edits write the row in the URL, not an Id from the body (#7427)
* fix: notification and user preference edits write the row in the URL, not an Id from the body refs #7426

* fix: notifications add ignores an Id in the body refs #7426
2026-11-24 22:37:49 -05:00
Jash 2928ab506a fix: re-registering a notification token keeps its owner unless an admin names one refs #7121 2026-11-21 22:39:30 +05:30
Pliable PixelsandClaude Opus 4.6 fea1c850ac fix: address Copilot review feedback on Notifications API refs #4684
- Revert accidental Users.RoleId FK change from CASCADE back to SET NULL
- Remove System != 'None' gate in beforeFilter; any authenticated user
  can manage their own notifications, per-row ownership checks suffice
- Add allowMethod('post', 'put') guard to edit() for consistent REST behavior
- Change PushState validation from allowEmpty to required=false

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 20:39:54 -05:00
Pliable PixelsandClaude Opus 4.6 9c455cc29d fix: make UserId nullable for no-auth mode refs #4684
- UserId is now DEFAULT NULL instead of NOT NULL
- FK changed to ON DELETE SET NULL (keep token if user deleted)
- Removed auth guard from add() — no-auth mode stores NULL UserId
- No-auth mode already treated as admin by _isAdmin(), so scoping
  works correctly (sees all tokens)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 20:09:32 -05:00
Pliable PixelsandClaude Opus 4.6 c6effc12ab fix: add FK constraint, auth guard, and belongsTo for Notifications refs #4684
- Add FOREIGN KEY on UserId -> Users.Id with ON DELETE CASCADE
  (both in fresh schema and migration)
- Reject push token registration when auth is disabled
  (UserId would be null, violating NOT NULL constraint)
- Add $belongsTo association to User in Notification model

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 20:04:03 -05:00
Pliable PixelsandClaude Opus 4.6 de1f31c6e2 feat: add Notification model, controller, and route refs #4684
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 19:47:29 -05:00