Menu ▾ ▴

#190 fix(notifications): duplicate dashboard path injected when clicking notifications or milestone insights

open
nobody
2026-11-20
2026-11-20
Anonymous
No

Originally created by: sumamakhan761

Summary

When navigating the dashboard (e.g., at /dashboard/[companyId]/crm), clicking on any notification in the Notifications dropdown or clicking "View Insights" inside a Milestone celebration modal causes the router to redirect to an invalid duplicated URL.

Current Behavior

Instead of routing cleanly to the intended destination (e.g., /dashboard/[companyId]/crm), the router pushes a duplicated route:
https://<domain>/dashboard/<companyId>/dashboard/<companyId>/<tab>

This results in a 404 page or broken navigation loop.

Expected Behavior

  • If a notification targets a relative feature tab (e.g., crm or /crm), it should route to /dashboard/<companyId>/crm.
  • If a notification or milestone already has an absolute dashboard URL (e.g., /dashboard/<companyId>/analytics), it should navigate directly without re-injecting the dashboard prefix.
  • External links (https://...) should open without prefix alteration.

Steps to Reproduce

  1. Log in and navigate to your dashboard at /dashboard/[companyId]/crm.
  2. Open the notification bell in the top navigation header.
  3. Click on any notification that contains a linkUrl or trigger a milestone celebration and click "View Insights".
  4. Notice the browser address bar contains /dashboard/[companyId]/dashboard/[companyId]/....

Where the Problem Lies

The redirect logic in apps/web/components/notifications/NotificationBell.tsx handles click navigation in two places (handleItemClick and the CelebrationModal onAction callback). In both places, ${basePath}/ is prepended directly to item.linkUrl without verifying whether item.linkUrl already contains the dashboard prefix or is already formatted as an absolute path.

Hint for Contributors

Look into apps/web/components/notifications/NotificationBell.tsx. Consider implementing a path resolution helper that inspects linkUrl before passing it to router.push:

  • Check if linkUrl already starts with http or already contains /dashboard / basePath.
  • Only prepend ${basePath} when dealing with a bare relative sub-route (e.g. crm or automation).

Discussion


Log in to post a comment.