c3c4178227
repos.listByTenant selected id,email,name,role,active,avatar_url,created_at but NOT last_seen or status. So /api/messages/contacts and /api/messages/conversations always sent lastSeen:null (and status:'active'). Last-seen only ever appeared via LIVE presence events (broadcastPresence reads the full row) — which is why it "worked on desktop" (caught live), not on a fresh iOS load, and why round-2's loadSidebar-on-focus then clobbered the live value → "Offline for all". Verified locally: contacts now returns the real lastSeen timestamp; db-smoke 22/22. Also lightened refreshPresenceOnResume: reconnect the socket if it's dead (its onopen already resyncs the sidebar) but no longer force an unconditional loadSidebar on every focus — that churn caused the #8 regression and could momentarily reset an unread badge (#3). Session sliding (touchSession) stays. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>