Skip to content

fix(mobile): keep thread watches live and stop composer flicker - #588

Merged
nixuuu merged 1 commit into
devfrom
fix/mobile-stream-flicker
Nov 12, 2026
Merged

nixuuu merged 1 commit into
devfrom
fix/mobile-stream-flicker

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

The mobile send/stop button briefly became disabled every five seconds. The sequence watch added in #541 refreshes controls on the same healthy stream; mobile interpreted each refresh as syncing until the following caught-up batch arrived. This is a readiness transition, not a periodic transport reconnect.

Share readiness classification across mobile and web/desktop: controls, metadata and unknown updates preserve readiness, while explicit catch-up still waits for a synchronized snapshot/batch. Development diagnostics record transition reasons, timestamps and watch-open counts without content or identifiers.

Share a one-second composer grace period across clients. A send accepted during recovery waits for actual live readiness before every attempt, retaining its immutable request/idempotency key. Stop stays reachable during recovery and waits for live; a queued Stop is discarded if its original turn has ended. Leaving the thread or pairing cancels queued work. Interrupt RPCs with an unknown outcome are not replayed.

Fixes: #541

Validation

  • Added real gateway↔client gRPC and binary mobile Connect coverage: 11.5 seconds after live, at least three controls messages (initial + two periodic refreshes), no non-live transition and no early stream end/reconnect.
  • Four domain tests pass (22 assertions), using fake timers for 50/100/150 ms interruptions, sustained outages, cancellation, initial catch-up and neutral controls updates.
  • Added real mobile send during a forced watch disconnect, resume from the sequence checkpoint and repeated acknowledgement lookup: one persisted turn and one worker input.
  • Dependency installation, full monorepo typecheck, lint and formatting pass. Final affected mobile/web typechecks also pass. CI runs generation checks, all four test shards through the temp-directory gate, and web/binary builds; the latest run is still pending.
  • Production fingerprints are unchanged before/after: iOS 6ddec9ef559ee0095ac33e94ff9418a942053b17, Android 5f6eae3ab278f1cd543e9ed763f923a319b65ec9. Mobile changes are JS/TS only; no native configuration or dependencies changed. No native build or OTA publication was run.
  • Both final production JS exports pass: iOS Hermes bundle 11,028,940 bytes / asset directory 6,506,870 bytes; Android Hermes bundle 11,021,080 bytes / asset directory 6,506,484 bytes. No device or browser visual review was performed; the checklist below remains unverified.

Device checklist (not performed)

  1. On a paired iPhone and Android device, open an idle thread for 30 seconds in light and dark mode. Type a draft. Confirm Send never dims at five-second intervals, keyboard focus and composer position stay fixed, and debug logs filtered to kind: thread show one watch start and no transition away from live.
  2. Start a long-running turn with the draft empty. Observe Stop for 30 seconds; confirm no periodic dimming. Repeat with a typed draft and Steer/Queue controls, with short and long model labels, and with reduced motion enabled.
  3. Briefly interrupt the gateway route for 100–150 ms while the app stays foreground. Tap Send during recovery. Confirm no disabled flash, one visible pending send, the original draft remains until acknowledgement, and exactly one message/turn reaches the worker after live resumes.
  4. During a running turn, disconnect for more than one second. Confirm Send becomes unavailable but Stop remains reachable. Tap Stop, restore the route and confirm the original turn stops. Repeat with that turn finishing before reconnect; confirm the next turn is not stopped. Leave the thread while Stop is waiting and confirm it is cancelled.
  5. Repeat after background/foreground, Wi-Fi↔cellular and VPN route changes. Confirm one intentional resubscription per change, sequence catch-up before queued delivery, stable feed/scroll position and no duplicate sends. Confirm archived/deleted threads and revoked sessions block immediately. Check web/desktop at desktop and phone widths in both themes.

Copy audit (docs/copy.md §8): no new user-facing wording; existing send, wait, error and Stop labels are reused. Controls retain their existing geometry.

@nixuuu
nixuuu force-pushed the fix/mobile-stream-flicker branch from 0214bd6 to 5bec44c Compare November 12, 2026 21:14
Treat periodic sequence controls as readiness-neutral, share composer grace and queued delivery, and retain Stop during recovery.

Fixes: #541
@nixuuu
nixuuu force-pushed the fix/mobile-stream-flicker branch from 5bec44c to 486c16b Compare November 12, 2026 21:17
@nixuuu
nixuuu marked this pull request as ready for review November 12, 2026 21:22
@nixuuu
nixuuu merged commit 3309e0d into dev Nov 12, 2026
11 checks passed
@nixuuu
nixuuu deleted the fix/mobile-stream-flicker branch November 12, 2026 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant