Skip to content

[Bug] Notification details screen shows something went wrong toast when viewing unviewed notification #778

@marcinkrasowski

Description

@marcinkrasowski

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

  1. Run npm run dev
  2. Log in as a user with mark_read permission (e.g. ORG_USER via mocked auth)
  3. Open the notification list
  4. Click on an UNVIEWED notification to view its details
  5. 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.tsx has a useEffect that auto-marks notifications as viewed when user has mark_read permission and notification status is UNVIEWED
  • packages/integrations/mocked/src/modules/notifications/notifications.service.ts throws NotImplementedException in markAs() 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 logic
  • packages/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

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions