Skip to Content
HomeLink Hub
Tenant Web App

Notifications

How live notifications arrive over the socket, where they are stored, and how the bell and the Notifications page behave.

Notifications in the tenant web app are live-only. They are pushed over the socket while the app is open, saved in the browser's localStorage, and read back from there. The app never fetches a notification history from the API.

Where it lives

RouteView / component fileAccess
/app/notificationssrc/views/app/notifications.tsxsigned-in
Bell and unread badgesrc/components/landing/navbar.tsxsigned-in
Socket listenersrc/app.tsxsigned-in at app start

Before you start

  • The listener is attached once, when the app starts, and only if an access token is already in sessionStorage at that moment.
  • Notifications are per browser. They do not follow the user to another device or browser, and they are not shared with the mobile app's notification list.

Flow

Receiving a notification

  1. On app start with a stored token, the app connects the shared socket, emits notifications:subscribe and listens for notifications:new.
  2. Each event carries id, type (property, messages, payments or security), title, body and an optional createdAt.
  3. The app builds a stored item with a time label (for example "Mar 6, 2:15 PM", or "Just now" when there is no valid date) and read: false.
  4. It writes the item to the front of the notifications array in localStorage, replacing any earlier item with the same id.
  5. It dispatches a browser event, app:notification:new, which the navbar and the Notifications page listen for.

The bell

  1. The navbar counts unread items in localStorage and shows a red badge on the bell, capped at 99+. On phones the menu button shows a red dot instead, and the drawer's Notifications row shows the count.
  2. The count refreshes on app:notification:new and on the browser's storage event, so another tab's changes are picked up.
  3. Clicking the bell marks every stored notification as read, resets the badge to zero and opens /app/notifications.

The Notifications page

  1. The page lists stored notifications, newest first, each with an icon by type, the title, body and time. Unread items are visually highlighted.
  2. Tabs filter by category: All, Property, Messages, Payments and Security.
  3. Clicking a notification marks that one as read. It does not navigate anywhere; notifications carry no link.
  4. When unread items exist the header reads "You have N unread notifications" and a Mark all as read button appears.
  5. New notifications that arrive while the page is open appear immediately.

Because the bell marks everything as read before opening the page, the unread header and Mark all as read are normally only seen when a notification arrives while the page is already open, or when the page is opened by URL.

States and edge cases

  • Empty. A bell icon with "No notifications here", for the whole list or for a tab with no items.
  • No loading or error state. The page reads localStorage synchronously and makes no request.
  • Signed out. The page still opens and shows whatever is stored in the browser.
  • Unknown type. Any type other than property, messages or payments is filed under Security.
  • No delete. Items cannot be removed from the UI, and the list is never trimmed.

Live delivery has gaps

Three things in the code limit when notifications actually arrive. First, the listener is only attached at app start when a token exists, so a user who has just signed in gets no live notifications until the next full page load. Second, the message page and the escrow tracking page disconnect and discard the shared socket when the user leaves them, which silently drops the listener until a reload. Third, anything sent while the app is closed is never fetched later. Treat the in-app list as best-effort; email is the dependable channel.

Stored notifications survive sign-out

Signing out removes the token, refresh token and user from storage but leaves the notifications key in place. The next person to sign in on the same browser sees the previous user's stored notifications.

What happens next

  • Reading a notification changes only the local read flag. Nothing is reported back to the backend.
  • Which events produce a notification is decided on the backend. The app tour describes the bell as the place where "Booking updates, inspection reminders and payment confirmations land".
  • Which channels a user receives (in-app, email) is set under Account and settings, Notifications tab.

On this page