Photo analysis now updates in real-time

Inventory refreshes as photo chunks complete, eliminating polling overhead during active analysis.

What's New

Photo analysis in the contents phase now uses Trigger.dev Realtime to push updates as soon as chunks complete, instead of polling the server every 1.5 seconds. When no analysis is running, the app makes zero requests for this data — the polling timer stops entirely.

While realtime is connected and proven, the refetch interval relaxes to a slow 15-second backstop (in case an event drops). If realtime becomes unavailable, the app automatically falls back to the full polling cadence, so there's no risk of stale data.

Under the hood

Chunk workers now signal the root analysis run's metadata counter immediately after each chunk commits to the database. The realtime subscriber detects these metadata changes and invalidates react-query state, triggering a fresh fetch. This closes a key gap in the system's responsiveness during the longest phase of the pipeline.