Bug Fixes
The upload-first/analyze-later contents flow had three cascading issues that made bulk uploads painful. First, pending photo counts froze during uploads because per-photo cache invalidations were cancelling the in-flight polling continuously. Second, analysis rows weren't created until minutes after upload, so pending badges vanished or never appeared. Third, the status subscription was always-on per room card, creating duplicate real-time connections that compounded the network spam.
All three are now fixed. PhotoAnalysis rows are created at confirm time, so pending badges appear immediately and survive page reloads. Upload-driven cache invalidations are throttled to a 2.5-second window, letting the status poll complete between uploads. Realtime subscriptions now gate to only the active pipeline stage, eliminating connection overhead. Polling itself converted from server actions (which purge the router cache) to a dedicated GET endpoint, stopping the cascade of page reloads during routine checks.
The result: bulk uploads stay responsive, per-photo badges transition from Pending → Queued → Analyzing as they progress, and network activity dropped from 5–15 requests/second during analysis to under 1 request/second. Inventory tab page loads went from 10+ seconds to under 1.2 seconds.