[Bug]: Mobile shows an offline machine's cached threads as current, with stale settle/snooze state#24530

opened17d agobyEebrardushullovcii

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/mobile

Steps to reproduce

Setup: two machines (a Mac and a Windows PC) running T3 Code, and the mobile app paired to both. The PC desktop app is also connected to the Mac as a remote environment.

  1. On the Mac, settle a few threads and snooze a few others. The PC app updates live.
  2. Shut down the Mac (or close T3 Code on it).
  3. Open the mobile app. It reaches the PC but not the Mac.
  4. Look at the thread list.

Expected behavior

Threads from the Mac are shown as offline or possibly out of date, so I can tell their state comes from an old cache and not from the Mac. The connection runtime doc says cached projections "must neither imply a live connection nor overwrite newer live data" (docs/internals/connection-runtime.md).

Actual behavior

  • The Mac's threads appear in the list just like live threads, with their state from whenever the phone last synced. Threads I settled are back as unsettled, and snoozed threads are back in the list.
  • Nothing on a thread or in the list shows that its state is stale or that the Mac is unreachable. I can't tell which threads are real and which are leftovers.
  • I can't fix them from the phone either: settle and snooze fail with "… is not connected." (#4852).

Impact

Major degradation or frequent failure

Version or commit

Desktop: 0.1.3-nightly.20261023.3592 (Windows). Mobile: current release.

Environment

macOS + Windows 11 desktops, mobile app paired to both.

Workaround

None, other than turning the Mac back on before opening the phone.


Related:

  • #8935 (show threads from unreachable environments as offline) was closed without merging.
  • Draft #22768 (recover cached threads when an environment is offline) is still open.
  • Ideas #24529 proposes a way for the phone to get the newer state from the relay while the machine is offline. This issue is only about the stale state being shown as current.
Synced from GitHub

Suggested fix: marking the threads as offline would stop them from looking current, but the phone would still show the wrong state. The correct state already exists on the Mac and on every client that saw the change, so the phone can get it without the Mac being online:

  • When a thread is settled, snoozed, unsnoozed or archived, the environment sends a small lifecycle row to the relay: environment ID, thread ID, settledAt, snoozedUntil, archivedAt, lifecycleUpdatedAt. No titles or messages. The relay already keeps more than this per thread in relay_agent_activity_rows.
  • When the environment is offline, the client reads those rows and applies only the ones newer than its cached shell. They are read-only, and live data from the environment always wins once it reconnects.

That fixes the stale state on the phone for T3 Connect environments. For LAN/Tailscale setups, the same rows could be served by another online environment (#20279). The full write-up is in Ideas #24529.

Synced from GitHub

Still seeing this on iOS 2.2.0 (202). It comes up for me with a work laptop that's often closed or off. While it's unreachable, all of its threads show as unsettled on my phone, including ones I already settled, so they mix in with my active threads until the laptop is back online. Threads that were working the last time the phone synced also stay on Working, even though they've finished on the laptop. Anyone using a laptop as one of their machines will likely hit this, not just when a machine goes down unexpectedly. Possibly related: #31491.