-
Notifications
You must be signed in to change notification settings - Fork 31
Description
Describe the bug
The notification details screen shows a "Something went wrong" toast when viewing an unviewed notification. This happens because the screen automatically calls the mark-as-read API when displaying a notification with UNVIEWED status (for users with mark_read permission), but the mocked Notifications integration throws NotImplementedException in its markAs() method. The HTTP error propagates to the frontend and triggers the error toast.
To Reproduce
- Run
npm run dev - Log in as a user with
mark_readpermission (e.g. ORG_USER via mocked auth) - Open the notification list
- Click on an UNVIEWED notification to view its details
- See the "Coś poszło nie tak" / "Something went wrong" toast
Expected behavior
No error toast should appear when viewing an unviewed notification. The mark-as-read operation should complete silently (or the mocked integration should support it).
Root cause
packages/blocks/notification-details/src/frontend/NotificationDetails.client.tsxhas auseEffectthat auto-marks notifications as viewed when user hasmark_readpermission and notification status isUNVIEWEDpackages/integrations/mocked/src/modules/notifications/notifications.service.tsthrowsNotImplementedExceptioninmarkAs()instead of handling the request
Proposed fix
Implement markAs in the mocked Notifications integration to return of(undefined) or similar instead of throwing NotImplementedException.
Desktop (please complete the following information):
- OS: Windows / macOS / Linux
- Browser: Any
- Version: Any
Additional context
Files involved:
packages/blocks/notification-details/src/frontend/NotificationDetails.client.tsx– client-side auto mark-as-read logicpackages/integrations/mocked/src/modules/notifications/notifications.service.ts– mocked service that needs the fix
This repo is using Opire - what does it mean? 👇
💵 Everyone can add rewards for this issue commenting
/reward 100 (replace 100 with the amount).🕵️♂️ If someone starts working on this issue to earn the rewards, they can comment
/try to let everyone know!🙌 And when they open the PR, they can comment
/claim #778 either in the PR description or in a PR's comment.🪙 Also, everyone can tip any user commenting
/tip 20 @marcinkrasowski (replace 20 with the amount, and @marcinkrasowski with the user to tip).📖 If you want to learn more, check out our documentation.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status