Skip to content

feat(pm-console): check the Android app with no connection on a device in CI (#13500) - #13645

Open
dezren39 wants to merge 1 commit into
mainfrom
xaltha/13500-android-offline-check
Open

dezren39 wants to merge 1 commit into
mainfrom
xaltha/13500-android-offline-check

Conversation

@dezren39

@dezren39 dezren39 commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

What this does

The Android app is the site in Chrome, and the site already works offline (service worker cache, outbox, Background Sync) — but that had only ever been checked in a desktop browser, never on a device. This adds the check #13500 asks for, and writes what Android does differently into the README.

  • New workflow .github/workflows/pm-console-android-offline.yml (nightly 07:17 UTC + manual, per the CI policy — no push trigger): builds the APK against the demo edge on the runner, starts the demo edge, starts an emulator, and drives the app — open, aeroplane mode, open again from the icon, answer a question, swipe the app away, network back — then checks the demo edge saw that answer exactly once.
  • pm-stack/console/android/offline-check.sh: the adb driver for the steps above (uiautomator taps, aeroplane mode via cmd connectivity, swipe-away via recents, act-log count).
  • The APK builds against a demo site: -PpmConsoleSite / PM_CONSOLE_SITE, defaulting to https://pm.security.cab, so the release build is unchanged. A demo site is plain http, so the app opens there as a Custom Tab rather than a verified TWA; the web content under test is the same.
  • The demo host records what it runs: PM_CONSOLE_DEMO_ACT_LOG names a file the demo appends one JSON line per canned action to — the witness the driver counts. Unset, the demo writes nothing. Covered by test/demo-act-log.test.ts.
  • README: what Android does differently under "With no connection" (the sync survives the app being swiped away; the undo pause is the page's own), and the check named in both READMEs.

Verification

  • test/demo-act-log.test.ts passes locally (1 pass); the full console suite is running remotely: developing-today/fleet#45246603296 (bun test in pm-stack/console).
  • The demo edge + act log were smoked locally: a question.answer POST through the edge returns {"ok":true} and appends exactly the expected JSON line.
  • The emulator check itself is running remotely as the equivalent of the workflow (developing-today/fleet#45249379802): SDK + AVD + APK build against the demo edge + offline-check.sh. A first attempt (45246862029) failed in 70ms on dispatch quoting, not on the check — the command is re-dispatched with no double quotes.
  • Note: gh workflow run cannot dispatch the new workflow from this branch — GitHub only dispatches workflows that exist on the default branch. The first run of pm-console-android-offline.yml happens after merge (nightly, or by hand); the fleet-command run above is the pre-merge evidence for the same steps.

Refs #13500


Show it working
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…e in CI (#13500)

The Android app is the site in Chrome, and the site already works
offline (service worker cache, outbox, Background Sync) — but that
had only ever been checked in a desktop browser, never on a device.
This adds the check the issue asks for, and writes what Android does
differently into the README.

- pm-console-android-offline workflow (nightly 07:17 UTC, manual):
  builds the APK against the demo edge on the runner, starts the
  demo edge, starts an emulator, and drives the app: open, aeroplane
  mode, open again from the icon, answer a question, swipe the app
  away, network back — then checks the demo edge saw that answer
  exactly once.
- offline-check.sh: the adb driver for the steps above.
- The APK builds against a demo site: -PpmConsoleSite /
  PM_CONSOLE_SITE, defaulting to https://pm.security.cab, so the
  release build is unchanged. A demo site is plain http, so the app
  opens as a Custom Tab rather than a verified TWA there.
- The demo host records every canned action it runs to
  PM_CONSOLE_DEMO_ACT_LOG (one JSON line each), the witness the
  driver counts; unset, the demo writes nothing. Covered by
  test/demo-act-log.test.ts.
- README: what Android does differently under 'With no connection'
  (the sync survives the app being swiped away; the undo pause is
  the page's own), and the check named in both READMEs.

Refs #13500
@coderabbitai

coderabbitai Bot commented Nov 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 7 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 81b0e044-9ba0-449d-ab7b-c7fabea91dd1
Commits

Reviewing files that changed from the base of the PR and between 91d1d63 and 0298d18.

Files selected for processing: 8

  • .github/workflows/pm-console-android-offline.yml
  • pm-stack/console/README.md
  • pm-stack/console/android/README.md
  • pm-stack/console/android/app/build.gradle
  • pm-stack/console/android/build.sh
  • pm-stack/console/android/offline-check.sh
  • pm-stack/console/scripts/demo-state.ts
  • pm-stack/console/test/demo-act-log.test.ts
  • 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

@dezren39

Copy link
Copy Markdown
Member Author

Verification update:

  • Full console suite passes on this branch: developing-today/fleet#45246603296 (bun test in pm-stack/console, success).
  • The emulator check as the workflow's equivalent: the first attempt (45246862029) failed in 70ms on dispatch quoting, not on the check. The second (45249379802) failed at the fleet-command runner's KVM gate — that runner is a container without /dev/kvm, so it cannot run the emulator with acceleration. That says nothing about the workflow, which runs on plain ubuntu-latest where KVM is available.
  • Re-dispatched with software emulation (-accel off) as the pre-merge evidence: developing-today/fleet#45251057051. It takes longer (system image download, TCG boot); results here when it lands.

This branch has not been deployed

No deployments
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