fix(network): raise the remaining short limits for slow links (1.0.5, versionCode 7) #28

Open
james.maes wants to merge 1 commits from fix/slow-link-timeouts into main
pull from: fix/slow-link-timeouts
Owner

Why

1.0.4 gave the metadata load 60 seconds. Every other call still had a 5 second call limit or OkHttp's 10 second defaults, so a slow warehouse link can still fail at start-up ("Unable to check QQQ UI API compatibility"), at enrollment or on a process step. This prepares 1.0.5 (versionCode 7). It is not signed, tagged or published.

What changes

All limits now come from one set, NetworkTimeouts (core), applied with two small builder helpers. Nothing else changes.

Calls Before Now Why
Opening the connection (every client) 10 s (OkHttp default) 10 s, named One round trip; an unreachable server is still reported quickly
Version discovery /qqq/v1/version 5 s whole call 30 s It runs before the first request of every client; a failure stops start-up
Branding, logo, reachability check (HostRuntime) 5 s whole call 30 s A call slower than 5 s fell back to default branding and showed "Disconnected"
Session heartbeat 5 s whole call 30 s A heartbeat slower than 5 s was abandoned, and an abandoned HTTP/1.1 call closes its connection, so the retry starts with a new TLS handshake
Device enrollment and status 10 s read and write, no call limit 30 s read and write, no call limit Small calls
Sign-in, table, process metadata, process status and other repository calls 10 s read and write 30 s read and write Small calls
Process init and step 10 s read and write 60 s read and write, no call limit If the client gives up after the server ran the step, the operator runs it twice
Metadata load 60 s 60 s Unchanged (1.0.4)
Ending the device session, live screen frames 5 s whole call 5 s, named Kept short on purpose: sign-out and Change server must not wait on a dead link, and a late frame is stale

Not touched: the 3 second coroutine bounds around sign-out, and the 30 second photo transfer limit in RecordFilesApi.

Trade-off to know about: on a link that goes silent without closing the connection, the footer can take up to 30 seconds (was 5) to show "Disconnected", and an ordinary call up to 30 seconds (was 10) to report failure.

Tests

  • NetworkTimeoutsTest (core): the constants, the helpers, and the connect, read, write and call limits of the version-discovery client and of the repository's ordinary, process and metadata clients.
  • SlowLinkTimeoutsTest (scanner-host): the limits of the branding/reachability client, the device client, the heartbeat client and the best-effort client.
  • NetworkQQQRepositoryTest: the test that pinned the 10 second default now expects an ordinary call to survive a server that answers after 12 seconds.

Docs

CHANGELOG 1.0.5 candidate entry. RELEASING.md, INSTALLATION.md, SESSION-STATE.md and TODO.md now record the published 1.0.4 (scanner-v1.0.4) and the 1.0.5 release steps.

Verification (local, at this commit)

Run on Windows with the Gradle wrapper, Java 21, at commit b1912cf:

Gate Result
node scripts/ci/check-source-standards.mjs passed for 268 authored source files
node --test scripts/ci/scanner-echo-guards.test.mjs 8 tests, 8 pass, 0 fail
./gradlew testDebugUnitTest :scanner-host:lintDebug :scanner-host:assembleDebug (CI line 1) BUILD SUCCESSFUL. 259 unit tests, 0 failures, 0 errors, 0 skipped (core 65, mobileapp 65, scanner-host 128, sample app 1). Debug lint: 0 errors, 0 warnings
./gradlew -PscannerTestBuildType=qa :scanner-host:assembleQa :scanner-host:assembleQaAndroidTest (CI line 2) BUILD SUCCESSFUL
./gradlew --no-daemon :scanner-host:lintRelease :scanner-host:assembleRelease -PscannerVersionName=1.0.5 -PscannerVersionCode=7 BUILD SUCCESSFUL. Release lint: 0 errors, 0 warnings. Unsigned APK: versionCode 7, versionName 1.0.5, not debuggable, 14,765,828 bytes, SHA-256 F33DCB760191AB952DC79A201A6A5EBE173E31023C7BA8192BDCF21057D3DAFB
connectedDebugAndroidTest (CI emulator step) Not validly run. The only local emulator is API 37 (CI uses API 30); on it 45 of the sample app's 46 tests fail inside Espresso with NoSuchMethodException: android.hardware.input.InputManager.getInstance, and the build stops there. Not compared against main. The hosted emulator step cannot run either until the runners get /dev/kvm

Not done: no signing, no tag, no release, no device install.

🤖 Generated with Claude Code

## Why 1.0.4 gave the metadata load 60 seconds. Every other call still had a 5 second call limit or OkHttp's 10 second defaults, so a slow warehouse link can still fail at start-up ("Unable to check QQQ UI API compatibility"), at enrollment or on a process step. This prepares 1.0.5 (versionCode 7). It is not signed, tagged or published. ## What changes All limits now come from one set, `NetworkTimeouts` (core), applied with two small builder helpers. Nothing else changes. | Calls | Before | Now | Why | |---|---|---|---| | Opening the connection (every client) | 10 s (OkHttp default) | 10 s, named | One round trip; an unreachable server is still reported quickly | | Version discovery `/qqq/v1/version` | 5 s whole call | 30 s | It runs before the first request of every client; a failure stops start-up | | Branding, logo, reachability check (`HostRuntime`) | 5 s whole call | 30 s | A call slower than 5 s fell back to default branding and showed "Disconnected" | | Session heartbeat | 5 s whole call | 30 s | A heartbeat slower than 5 s was abandoned, and an abandoned HTTP/1.1 call closes its connection, so the retry starts with a new TLS handshake | | Device enrollment and status | 10 s read and write, no call limit | 30 s read and write, no call limit | Small calls | | Sign-in, table, process metadata, process status and other repository calls | 10 s read and write | 30 s read and write | Small calls | | Process init and step | 10 s read and write | 60 s read and write, no call limit | If the client gives up after the server ran the step, the operator runs it twice | | Metadata load | 60 s | 60 s | Unchanged (1.0.4) | | Ending the device session, live screen frames | 5 s whole call | 5 s, named | Kept short on purpose: sign-out and Change server must not wait on a dead link, and a late frame is stale | Not touched: the 3 second coroutine bounds around sign-out, and the 30 second photo transfer limit in `RecordFilesApi`. Trade-off to know about: on a link that goes silent without closing the connection, the footer can take up to 30 seconds (was 5) to show "Disconnected", and an ordinary call up to 30 seconds (was 10) to report failure. ## Tests - `NetworkTimeoutsTest` (core): the constants, the helpers, and the connect, read, write and call limits of the version-discovery client and of the repository's ordinary, process and metadata clients. - `SlowLinkTimeoutsTest` (scanner-host): the limits of the branding/reachability client, the device client, the heartbeat client and the best-effort client. - `NetworkQQQRepositoryTest`: the test that pinned the 10 second default now expects an ordinary call to survive a server that answers after 12 seconds. ## Docs CHANGELOG 1.0.5 candidate entry. `RELEASING.md`, `INSTALLATION.md`, `SESSION-STATE.md` and `TODO.md` now record the published 1.0.4 (`scanner-v1.0.4`) and the 1.0.5 release steps. ## Verification (local, at this commit) Run on Windows with the Gradle wrapper, Java 21, at commit `b1912cf`: | Gate | Result | |---|---| | `node scripts/ci/check-source-standards.mjs` | passed for 268 authored source files | | `node --test scripts/ci/scanner-echo-guards.test.mjs` | 8 tests, 8 pass, 0 fail | | `./gradlew testDebugUnitTest :scanner-host:lintDebug :scanner-host:assembleDebug` (CI line 1) | BUILD SUCCESSFUL. 259 unit tests, 0 failures, 0 errors, 0 skipped (core 65, mobileapp 65, scanner-host 128, sample app 1). Debug lint: 0 errors, 0 warnings | | `./gradlew -PscannerTestBuildType=qa :scanner-host:assembleQa :scanner-host:assembleQaAndroidTest` (CI line 2) | BUILD SUCCESSFUL | | `./gradlew --no-daemon :scanner-host:lintRelease :scanner-host:assembleRelease -PscannerVersionName=1.0.5 -PscannerVersionCode=7` | BUILD SUCCESSFUL. Release lint: 0 errors, 0 warnings. Unsigned APK: versionCode 7, versionName 1.0.5, not debuggable, 14,765,828 bytes, SHA-256 `F33DCB760191AB952DC79A201A6A5EBE173E31023C7BA8192BDCF21057D3DAFB` | | `connectedDebugAndroidTest` (CI emulator step) | Not validly run. The only local emulator is API 37 (CI uses API 30); on it 45 of the sample app's 46 tests fail inside Espresso with `NoSuchMethodException: android.hardware.input.InputManager.getInstance`, and the build stops there. Not compared against `main`. The hosted emulator step cannot run either until the runners get `/dev/kvm` | Not done: no signing, no tag, no release, no device install. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
james.maes added 1 commit 2026-11-10 01:42:52 +00:00
fix(network): raise the remaining short limits for slow links (1.0.5, versionCode 7)
android / android (push) Failing after 4m1s
build / android (push) Failing after 4m1s
b1912cf59c
1.0.4 gave the metadata load 60 seconds. Every other call still had a
5 second call limit or OkHttp's 10 second defaults, so a slow warehouse
link could still fail start-up, enrollment or a process step.

All limits now come from one set, NetworkTimeouts:
- connect 10 s (unchanged value, now named)
- small calls 30 s: version discovery, branding, logo, reachability and
  the session heartbeat (were a 5 s call limit); device enrollment and
  status, sign-in, table and process-status calls (were a 10 s read)
- process init and step 60 s read and write, no call limit as before
- metadata load 60 s (unchanged)
- best-effort calls 5 s (unchanged): ending the device session and live
  screen frames, so sign-out, Change server and screen viewing never
  wait on a dead link

Not changed: the 3 s bounds around sign-out and the 30 s photo transfer
limit.

Tests assert the configured limits of every client (NetworkTimeoutsTest,
SlowLinkTimeoutsTest); the test that pinned the 10 s default now expects
an ordinary call to survive a 12 s answer.

Docs: CHANGELOG 1.0.5 candidate; RELEASING, INSTALLATION, SESSION-STATE
and TODO record the published 1.0.4 and the 1.0.5 release steps.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Some required checks failed
android / android (push) Failing after 4m1s
build / android (push) Failing after 4m1s
You are not authorized to merge this pull request.
This pull request can be merged automatically.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin fix/slow-link-timeouts:fix/slow-link-timeouts
git checkout fix/slow-link-timeouts
Sign in to join this conversation.