Wiki/Notifications & Realtime/Realtime in the Deal Room (and the Two Other Places)
02Notifications & Realtime3 min read

Realtime in the Deal Room (and the Two Other Places)

Which three screens are subscribed to live database changes, why the auction lot also ticks on a timer, and why the inventory list is not on the list.

Polling loops on a warehouse tablet are an excellent way to drain a battery and saturate a shop-floor network. The platform pushes Postgres change events over a WebSocket instead — but only where two people can act on the same object in the same second, which turns out to be three screens.

The three

The deal room subscribes to the messages, the offers and the deal’s own status row, filtered to that one deal: a counter-offer typed in Rotterdam appears in Hamburg without either side reloading. The notification bell subscribes to your notifications, so the unread count moves on its own. The auction lot subscribes to the lot and to bids: the current high bid and the closing time reach everyone watching, and your own bid flipping from winning to outbid is what powers the outbid state on screen. That is the complete list.

Row-level security travels with the event

The rules that decide what you may read decide what you may receive. Lot updates are readable by every bidder, so a new high bid propagates across tenants. Bid rows are your own tenant only, so you watch your bid being beaten without ever seeing the bid that beat it. The browser subscribes, an event arrives, the component re-reads the affected data and rerenders. No polling loop, and no accidental window into somebody else’s book.

The lot’s extra heartbeat

The auction lot page also refreshes itself every 30 seconds, permanently, alongside the subscription. It is not a fallback that switches on when the socket fails — nothing detects that — it is a safety net for a socket that dropped silently and never mentioned it. Thirty seconds is a deliberate number: short enough that a missed event costs you half a minute, long enough that a dozen open lot tabs are not re-rendering and re-signing their gallery thumbnails every few seconds.

What is not live, and why that is fine

Inventory lists, receiving sessions and the reporting screens subscribe to nothing. They read when you open them and again after your own action. A pallet does not change while you are looking at it, and a colleague selling a laptop three aisles away does not change what you should do with the one in your hand. Live updates belong on the screens where somebody else is moving the same piece; everywhere else they are a battery bill with a subscription fee.