Skip to content

fix(ios): keep the opening cover, with a progress bar, until the client is up on a slow link - #3851

Merged
devswha merged 2 commits into
mainfrom
fix/ios-slow-open
Nov 14, 2026
Merged

devswha merged 2 commits into
mainfrom
fix/ios-slow-open

Conversation

@devswha

@devswha devswha commented Nov 14, 2026

Copy link
Copy Markdown
Owner

Why

The iOS twin of #3850 (Android). iOS hides its opening cover at the PC's first response, so it never cut a slow page off as Android did; but on a slow link (10 KB/s, a VPN) what followed was an unpainted web view and then index.html's loading spinner for about two minutes, with no sign that anything was arriving. Before the first response, a 20 s timer still gives up, and its text blamed the PC for a public server.

What changes

  • OpeningWatch.swift (new, pure): the cover's stage. Before the PC answers, the open gives up after the same 20 s (iOS has no count of received bytes, so a TLS handshake still under way then counts as no answer). After it answers, the open is never called off.
  • HerdrBridgeViewController: the cover stays until the client is up (its #root no longer holds .boot; a page with no root, such as the error page, lifts it as before), asked five times a second, so it lifts within 0.2 s of the client's first frame. A bar fills from the web view's estimatedProgress (never back, held at 95 %); after 5 s the cover says "Slow connection. Still opening X..." with Try again and Change PC. Only an http(s) document counts as the client: the PC answers before its page commits, while the web view still holds its empty first document (found on the simulator: without it the cover lifted at once).
  • No stall claim on iOS: estimatedProgress held still at about 40 % while the 977 KB script arrived at 10 KB/s, so it cannot tell a stalled link from a slow one (a first build that tried said "nothing has come for 20 seconds" mid-download). Try again is there instead.
  • The no-answer text for a public server says it may be down or out of the phone's reach, as on Android; a home network or tailnet address keeps the old text. English and Korean.

Checked on eamac's iOS 27 simulator (iPhone 17), the app built from this branch, a test Ovis behind a throttling proxy at 10 KB/s and 300 ms

main this PR
40 s blank screen cover, bar, "Slow connection"
100 s blank, then index.html's spinner cover, bar, Try again
client up about 140 s about 140 s, the cover lifting with it

before, 40 s
after, 40 s
after, 100 s
Korean
client up, cover gone

Shipping

iOS 1.0 is in App Review: this does not touch that build. It ships as the first iOS update after 1.0 passes review.

Validation

  • swiftc app/ios/App/App/OpeningWatch.swift app/ios/OpeningWatchCheck/main.swift on eamac: all checks passed (no answer at the limit, slow never given up, bar never back and held below full, progress before an answer ignored, a held progress not a stall, home and public hosts).
  • xcodebuild -sdk iphonesimulator on eamac: built; the runs above on that build (a fresh clone in /tmp there, deleted afterwards; eamac's slot taken and released).
  • bun run check fast: passed (typecheck, build, unit tests 17258 pass / 0 fail).

… is up

A PC that answered over a slow link showed a blank page, then index.html's
spinner, for minutes. The cover now stays until the client is up, with a
bar from the web view's estimatedProgress (never back, held below full),
says the connection is slow after 5 s and offers Keep waiting and Try
again after 20 s without progress (OpeningWatch, checked by
app/ios/OpeningWatchCheck). A timeout to a public server no longer
blames the PC.
…n page

Checked on the iOS 27 simulator: estimatedProgress holds still while one
large file arrives, so the cover never claims a stall and offers Try
again once slow; it asks the page five times a second, so it lifts within
0.2 s of the client; and only an http(s) document counts as the client
being up, as the PC answers before its page commits, while the web view
still holds its empty first document.
@coderabbitai

coderabbitai Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • New Features
    • The iOS loading screen now shows progress while a PC page loads and stays visible until the page is ready.
    • On a slow connection, the screen offers a Try again option. If the PC does not respond, it displays a no-answer message with connection guidance where applicable.
  • Documentation
    • Updated iOS app documentation to explain loading behavior, progress estimates, and connection timeouts.

The iOS opening flow now tracks whether the PC has answered, reports page-load progress, and checks when the client is ready. The loading cover shows slow-connection or no-answer states, with updated connection guidance and documentation.

Changes: iOS Opening Flow

Layer / File(s) Summary
Opening state and checks
app/ios/App/App/OpeningWatch.swift, app/ios/OpeningWatchCheck/main.swift
OpeningWatch tracks opening stages, post-answer progress capped at 95%, and host classification. The standalone check harness covers stage timing, progress behavior, and host examples.
Cover lifecycle and app integration
app/ios/App/App/HerdrBridgeViewController.swift, app/ios/App/App.xcodeproj/project.pbxproj, docs/native-app.md, changelog.d/ios-slow-link-progress.md
The controller polls the watch, updates the loading cover, and checks page readiness before dismissing it. It shows a slow-connection state after five seconds and a no-answer screen at the answer limit. The project registers OpeningWatch.swift; the documentation and changelog describe the updated behavior.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Bug fix

Merge Risk: Minimal · up to 422e4

The change keeps the iOS opening cover visible with a progress bar until the client is up, and adds slow-connection and no-answer messaging. No concrete merge-blocking risk was identified in the reviewed changes.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: the iOS opening cover stays until the client is up on a slow link, with a progress bar. The changeset matches this (OpeningWatch stage tracking, cover lifecycle, progr…
Description check Passed The description follows the template's Change and Validation sections. The Change section explains the problem (blank web view and a long spinner on slow links), the new OpeningWatch behavior, the pro…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: the iOS opening cover stays until the client is up on a slow link, with a progress bar. The changeset matches this (OpeningWatch stage tracking, cover lifecycle, progress bar, slow-connection message). The title is specific and follows the conventional-commit style. It is a little long at 92 characters.

Full details: Description check

Explanation

The description follows the template's Change and Validation sections. The Change section explains the problem (blank web view and a long spinner on slow links), the new OpeningWatch behavior, the progress bar, the slow-connection message, and the public-server wording. The Validation section lists the swiftc harness run, the xcodebuild simulator build, the simulator runs, and bun run check fast with results. It does not link an issue in the Change section, though the template asks for one on features. This PR is a fix that references #3850 and #3851, so the gap is minor. The changelog entry is in changelog.d, which the template mentions, and the PR does not say the changelog was checked. The description is mostly complete.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 70e9ed7 and 422e41f.

Files selected for processing: 6

  • app/ios/App/App.xcodeproj/project.pbxproj
  • app/ios/App/App/HerdrBridgeViewController.swift
  • app/ios/App/App/OpeningWatch.swift
  • app/ios/OpeningWatchCheck/main.swift
  • changelog.d/ios-slow-link-progress.md
  • docs/native-app.md

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

@devswha

devswha commented Nov 14, 2026

Copy link
Copy Markdown
Owner Author

Merge-pass leftovers at 422e41f, not pushed (each push restarts CI and the reviews):

  • No test of the cover-lift path, OpeningWatchCheck runs in no CI: true; the path (clientUpScript, askPage, the about:blank guard) was checked on the iOS 27 simulator, and the guard came from that run. OpeningWatchCheck ran on eamac at this head. Wiring it into the macOS CI job is a follow-up.
  • A later failure reads "Slow connection": a main-frame failure after the answer goes through onPageFailed to showFailure, which loads error.html; once that page has loaded (onLoaded), askPage sees a page that is not the PC's and lifts the cover. Not run on the simulator.
  • "Slow connection" counts from the start, Try again restarts the download: as on Android (5 s from the open); Try again reloads, which over a slow link does start over, so it is the second choice under the bar, not the first.
  • Docs mention fix(android): keep opening a PC while its page arrives over a slow link #3850's stall message: only to say that iOS never claims a stall, unlike Android.

This ships as the first iOS update after 1.0 passes review.

@devswha
devswha merged commit 2decd45 into main Nov 14, 2026
13 checks passed
@devswha

devswha commented Nov 14, 2026

Copy link
Copy Markdown
Owner Author

Merge pass

Merged head 422e41f4766b as 2decd453d6a2 on GitHub's checks, with no unresolved review threads.

Reviewer Verdict Note
claude CLEAR
codex CLEAR

Two reviewers at this head: Claude (Opus) CLEAR, Codex Terra CLEAR. app/ and its tests; merges on GitHub's checks. The iOS twin of #3850: the opening cover stays, with a progress bar, until the client is up on a slow link, and lifts within 0.2 s of it. It ships only after App Review passes 1.0.

Left (MEDIUM, Claude): the cover-lift path (clientUpScript, askPage, the about:blank guard) has no automated test, and the new Swift check runs nowhere. LOW: once the PC answered, a later failure reads "Slow connection"; Slow connection counts 5 s from the start.

@devswha
devswha deleted the fix/ios-slow-open branch November 14, 2026 18:39
devswha pushed a commit that referenced this pull request Nov 14, 2026
…3860)

## Change

`scripts/compressed-assets.ts` writes every JS, CSS and wasm file's
Brotli sidecar at quality 5. That's quick to build, but the few files a
browser must fetch before the app can start are also the largest: the
entry script is 3.81 MB minified. Those files now get Brotli's best
(quality 11). Every lazy chunk, which is most of the bundle, stays at 5,
so builds stay quick.

The plugin picks those files by what the built pages name, read from the
bundle's `.html` assets at `writeBundle`: the entry's module script, the
modules Vite preloads beside it, its stylesheet, and the theme's boot
script (`scripts/theme-bootstrap-build.ts`, a classic script in
`<head>`, emitted as an asset, so the chunk graph alone would miss it).
gzip sidecars are unchanged (level 9), and nothing changes in how the
server picks a sidecar.

Measured in the CI runner's image
(`scripts/self-hosted-runner/Dockerfile`, built locally) on main
2decd45 and on this branch:

| What `index.html` loads before the app runs | main (Brotli 5) | this
PR (Brotli 11) |
| --- | ---: | ---: |
| `assets/index-*.js` (3,812,177 B) | 978,248 B | 839,759 B (−14.2%) |
| `assets/index-*.css` (558,813 B) | 83,440 B | 67,781 B (−18.8%) |
| The module script, its 3 preloads and the stylesheet | 1,065,526 B |
911,114 B (−154,412 B, −14.5%) |
| The same, gzip | 1,247,170 B | 1,247,160 B |

The theme's boot script (34,134 B) is 4,177 B at quality 11. Over the
whole bundle (436 files) the Brotli sidecars go from 4,991,599 B to
4,837,264 B: the rest is the lazy chunks, unchanged. For a phone on a
slow link, 154 KB is about 1.2 s at 1 Mbit/s, the case #3851's opening
cover is for.

The cost is build time: `bun run build` three times in a row in that
image took 4.0, 2.3 and 1.9 s on main and 6.9, 4.9 and 5.0 s here, about
3 s more.

`scripts/compressed-assets.test.ts`, which already makes a production
build, now reads that build's `index.html` and checks each sidecar byte
for byte: a file the page names at quality 11, every other one at 5. It
also checks that the page names at least one script and one stylesheet,
and that at least one lazy chunk is left. On main it fails at
`theme-bootstrap-f10f765732.js at quality 11`. It takes about 10 s in
the image now, since it compresses each file again to compare.

## Validation

- `scripts/compressed-assets.test.ts` in the image: passes on this
branch (2183 expects), fails on main as above.
- `bun run check fast` in the image: workflow syntax, generated types
and themes, typecheck and build pass. Unit tests: 17266 pass, 1 fail, 57
skip in 955 files. The failure, `scripts/plugin.test.ts` "add and login
> run the release the app updated to as link, the one name a release
from before them knows" (it prints "This PC is already in an Ovis
account" instead of handing over to the release), fails the same way on
main (2decd45) in that image. `bun run build:shell` passes.
- The sizes and timings above: `bun run build` on a fresh clone of each,
in the same image, then a throwaway script (not in this PR) that reads
`dist/index.html` and sizes what it names, and recompresses each file to
tell which quality its sidecar has.

Not run: `bun run check full`, the Windows and macOS jobs, or a page
load over a real slow link.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <[email protected]>
devswha added a commit that referenced this pull request Nov 15, 2026
…with 0.5.4 (#3889)

## Summary

The store builds that went out with 0.5.4 raised their version numbers
only in the build, so the repository still names the numbers before
them. This sets the repository to what was uploaded, so the next store
build does not reuse a build number the stores have already taken.

- **Android:** `app/android/app/build.gradle` raises `versionCode` from
8 to 9 and `versionName` from 1.0.1 to 1.0.2. 1.0.2 (9) is the bundle
built from v0.5.4 (`b9d07980`). It was sent to Google Play's production
review on 2026-11-15.
- **iOS:** `app/ios/App/App.xcodeproj/project.pbxproj` raises
`MARKETING_VERSION` from 1.0 to 1.0.1 and `CURRENT_PROJECT_VERSION` from
7 to 9. The App and OvisNotifications targets share these project-level
settings. 1.0.1 (9) is the build from the same commit. It was submitted
for App Review on 2026-11-15 and carries the slow-link fix (#3851).
Build 8 is version 1.0 on the App Store.
- **Docs:** the version rows in `app/store/android.md` and
`app/store/ios.md` show these numbers and name the last upload.

Nothing here builds or uploads. The next upload raises Android to
`versionCode` 10 and iOS to build 10.

## Validation

- `bun run check fast` passed: workflow syntax, generated types and
themes, typecheck, build, and unit tests (17314 pass, 0 fail, 54 skip).
- No test reads `versionCode`, `versionName`, `MARKETING_VERSION` or
`CURRENT_PROJECT_VERSION`, according to `git grep` over the test files
and `scripts/`. The only hit is `scripts/android-ime-regression.ts`,
which reads the installed Chrome and Gboard versions.
- The numbers match what the stores hold, as of 2026-11-15:
  - Play Console's Production track shows "9 (1.0.2)" in review.
- The App Store Connect API shows version 1.0.1 Waiting for Review with
build 9 (VALID). It shows builds 5 to 8 before it.
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