Skip to content

fix(ios): keep connection messages from flashing when chat reopens - #207233

Merged
vyctorbrzezowski merged 1 commit into
mainfrom
brzezowski/ios-connecting-wait
Nov 28, 2026
Merged

vyctorbrzezowski merged 1 commit into
mainfrom
brzezowski/ios-connecting-wait

Conversation

@vyctorbrzezowski

Copy link
Copy Markdown
Member

What Problem This Solves

When you return to an iPhone chat, “Connecting to…” can already be above the composer and disappear a moment later. A cold launch with no reply can have the opposite problem: switching between “Connecting” and “Not connected” restarts the wait, even though the chat never connected.

User Impact

A quick return no longer flashes a connection message. A disconnected message that is already visible stays visible when the app is temporarily inactive. On a cold launch, chat waits three seconds from its first pending connection status, even if the wording changes. Foreground reconnects still wait one second. The connection itself and its wording are unchanged.

Why This Change Was Made

Time in the background is not time spent waiting in chat. The strip ends its wait when the app enters the background and starts a fresh one when it returns to the foreground, without waiting for the app to become active. While the connection is still pending, the existing strip timer keeps the deadline from the first post; other messages keep their existing behavior.

Evidence

Before the fix, the light-appearance recording showed “Connecting to…” on the first readable chat frame after returning from Settings. It disappeared about 0.77 seconds later. After the fix, neither the light nor the dark recording showed a connection message on return.

On a cold launch with no reply, the revised app showed the message 3.06 seconds after the composer became readable, or 3.89 seconds after the header. It stayed visible for the rest of the recording. Holding a local test server’s handshake for 0.5 or 2 seconds showed no message; a 5-second hold showed the message until the connection recovered. An ordinary cold launch against a local test server did not reproduce the return flash.

The clock-controlled background test failed before the fix for both first connections and reconnects. The updated test also covers a visible disconnected message through an inactive interruption, and a wording change without a new deadline. All 11 iOS connection-status tests and all 9 shared status-strip tests passed. The iOS build passed SwiftFormat and strict SwiftLint.

First frame after returning to the chat from Settings, light appearance. Before, on the left, "Connecting to OpenClaw…" is already above the composer. After, on the right, no connection message shows.

The same return in dark appearance. Before, on the left, "Not connected to OpenClaw" is already above the composer. After, on the right, no connection message shows.

Cold launch against a server that answers quickly, frame by frame. Before and after, no connection message shows.

Cold launch with no reply, frame by frame. Before and after, "Connecting to OpenClaw…" appears at about four seconds and stays.

I used an iPhone simulator and a local test server. I did not test a physical iPhone, a real slow network, or a physical Control Center gesture.

Stacked on #206685. The connection strip this change builds on comes from #206678.

🦞 Made with OpenClaw

@clawsweeper

clawsweeper Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. impact:ux-friction User-facing flow adds avoidable confusion or support burden without fully blocking progress. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Nov 28, 2026
@clawsweeper

clawsweeper Bot commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

Codex review: passed.

What this changes

This PR resets connection-message waits after backgrounding and preserves their deadline when connection wording changes.

Example: Return from Settings to an iPhone chat that reconnects within one second.

  • Before: “Connecting to OpenClaw…” can appear immediately because background time consumed its delay.
  • After: The foreground wait starts fresh, so a quick reconnect shows no connection message.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, worthwhile repair with directly relevant simulator evidence and distinct regression coverage; the draft and pending Swift check remain landing-state considerations.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (screenshot): Inspected simulator comparisons exercise the iOS chat UI on return from Settings and during fast and unanswered cold launches; the body also reports delayed-handshake recovery and base-red/head-green lifecycle tests, while explicitly excluding physical-device testing.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Returning to chat can briefly show a misleading connection message, while changing pending-state wording can postpone useful connection feedback.
Reason: The repair fulfills the existing strip's explicit no-flash intent, and maintainer authorship supplies the direction decision.

Merge readiness

✅ Ready for maintainer review

Keep this maintainer-authored draft open: the focused timing repair is useful, and no introduced correctness defects were found; it remains part of an unmerged iOS stack.

Reviewed head: 85135acd817843b509f36795037de8f0fc4907af

Before merge

None.

Findings

None.

Agent review details

How this fits together

The iOS chat modifier translates connection state and scene lifecycle into statuses; the shared strip owns their visibility deadlines and supplies the message rendered above the composer.

flowchart LR
  A[Gateway connection state] --> C[Chat connection modifier]
  B[Scene lifecycle] --> C
  C --> D[Shared status strip]
  D --> E[Visibility deadline]
  E --> F[Composer status row]
Loading

Technical review

Best possible solution:

Keep lifecycle handling in the iOS modifier and deadline continuity in the existing shared strip, then land this repair with its prerequisite stack.

Do we have a high-confidence way to reproduce the issue?

The stacked base counts background time toward visibility and restarts the deadline for changed wording; supplied simulator comparisons demonstrate the flash, but this behavior is absent from fetched main and was not independently executed during this read-only review.

Is this the best way to solve the issue?

The patch restores the strip's intended no-flash behavior using its existing lifecycle and timer owners, preserves inactive-state visibility, and introduces no competing timing mechanism.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 9c9e3c74e3c6.

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

PR surface

Source +13, Tests +72. Total +85 across 4 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 22 9 +13
Tests 2 73 1 +72
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 95 10 +85

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 27, 2026, 11:45 PM ET / November 28, 2026, 04:45 UTC.

Base automatically changed from brzezowski/ios-talk to main November 28, 2026 06:01
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: macos App: macos scripts Repository scripts size: XL and removed size: S labels Nov 28, 2026
@vyctorbrzezowski
vyctorbrzezowski force-pushed the brzezowski/ios-connecting-wait branch from 85135ac to 7f25cbf Compare November 28, 2026 06:23
@openclaw-barnacle openclaw-barnacle Bot added size: S and removed docs Improvements or additions to documentation app: macos App: macos scripts Repository scripts size: XL labels Nov 28, 2026
@vyctorbrzezowski
vyctorbrzezowski marked this pull request as ready for review November 28, 2026 07:18
@vyctorbrzezowski
vyctorbrzezowski merged commit fbe4bc6 into main Nov 28, 2026
76 checks passed
@vyctorbrzezowski
vyctorbrzezowski deleted the brzezowski/ios-connecting-wait branch November 28, 2026 07:18
vincentkoc added a commit that referenced this pull request Nov 28, 2026
* commit '262f14aab89ca286633992760fa45aeeded998f9': (207 commits)
  fix(ui): remove redundant type argument from Board browser test (#207352)
  test(channels): distinguish status and batch fixtures (#207232)
  fix(ui): type the Board drop test mock as void (#207348)
  fix(ui): break the Skill Workshop import cycle (#207345)
  test(channels): expose label guard regressions (#207195)
  fix: explain when a previous automation run keeps the agent from starting (#207180)
  refactor(test): consolidate loader proof and repair rollback coverage (#207152)
  fix(agents): one tool-result bound on every route, untrusted-content wrapper intact (#207101)
  test(plugins): verify staged SDK named exports (#207170)
  fix(ui): truncate empty Compose hints on narrow screens (#207301)
  fix: keep unsent Cmd+K Compose drafts when reopened (#207307)
  fix: explain chat update errors when a session changes (#206419)
  fix(ios): keep consecutive commands on one line in chat (#207242)
  fix(ios): keep connection messages from flashing when chat reopens (#207233)
  fix(ios): give Sessions groups more breathing room (#207221)
  fix(ui): show chat completions as activity rows (#201891)
  fix(ui): make empty composer hints look distinct from drafts (#207295)
  fix: explain why chat won’t attach an empty file (#206402)
  fix(agents): show Doctor's restore-first warning before deleting a held store (#207290)
  test(channels): fix join failure proof and trim probe fixture (#207264)
  ...
vincentkoc added a commit that referenced this pull request Nov 28, 2026
* commit '262f14aab89ca286633992760fa45aeeded998f9': (207 commits)
  fix(ui): remove redundant type argument from Board browser test (#207352)
  test(channels): distinguish status and batch fixtures (#207232)
  fix(ui): type the Board drop test mock as void (#207348)
  fix(ui): break the Skill Workshop import cycle (#207345)
  test(channels): expose label guard regressions (#207195)
  fix: explain when a previous automation run keeps the agent from starting (#207180)
  refactor(test): consolidate loader proof and repair rollback coverage (#207152)
  fix(agents): one tool-result bound on every route, untrusted-content wrapper intact (#207101)
  test(plugins): verify staged SDK named exports (#207170)
  fix(ui): truncate empty Compose hints on narrow screens (#207301)
  fix: keep unsent Cmd+K Compose drafts when reopened (#207307)
  fix: explain chat update errors when a session changes (#206419)
  fix(ios): keep consecutive commands on one line in chat (#207242)
  fix(ios): keep connection messages from flashing when chat reopens (#207233)
  fix(ios): give Sessions groups more breathing room (#207221)
  fix(ui): show chat completions as activity rows (#201891)
  fix(ui): make empty composer hints look distinct from drafts (#207295)
  fix: explain why chat won’t attach an empty file (#206402)
  fix(agents): show Doctor's restore-first warning before deleting a held store (#207290)
  test(channels): fix join failure proof and trim probe fixture (#207264)
  ...
vincentkoc added a commit that referenced this pull request Nov 28, 2026
* commit '262f14aab89ca286633992760fa45aeeded998f9': (207 commits)
  fix(ui): remove redundant type argument from Board browser test (#207352)
  test(channels): distinguish status and batch fixtures (#207232)
  fix(ui): type the Board drop test mock as void (#207348)
  fix(ui): break the Skill Workshop import cycle (#207345)
  test(channels): expose label guard regressions (#207195)
  fix: explain when a previous automation run keeps the agent from starting (#207180)
  refactor(test): consolidate loader proof and repair rollback coverage (#207152)
  fix(agents): one tool-result bound on every route, untrusted-content wrapper intact (#207101)
  test(plugins): verify staged SDK named exports (#207170)
  fix(ui): truncate empty Compose hints on narrow screens (#207301)
  fix: keep unsent Cmd+K Compose drafts when reopened (#207307)
  fix: explain chat update errors when a session changes (#206419)
  fix(ios): keep consecutive commands on one line in chat (#207242)
  fix(ios): keep connection messages from flashing when chat reopens (#207233)
  fix(ios): give Sessions groups more breathing room (#207221)
  fix(ui): show chat completions as activity rows (#201891)
  fix(ui): make empty composer hints look distinct from drafts (#207295)
  fix: explain why chat won’t attach an empty file (#206402)
  fix(agents): show Doctor's restore-first warning before deleting a held store (#207290)
  test(channels): fix join failure proof and trim probe fixture (#207264)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: ios App: ios impact:ux-friction User-facing flow adds avoidable confusion or support burden without fully blocking progress. P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant