Skip to content

test(evals): background-desktop-update exercises the error/install auto-check skip with automatic checks on - #4821

Merged
yomgui merged 7 commits into
devfrom
e2e/updater-guard-coverage-after-4761
Sep 11, 2026
Merged

yomgui merged 7 commits into
devfrom
e2e/updater-guard-coverage-after-4761

Conversation

@yomgui

@yomgui yomgui commented Sep 10, 2026

Copy link
Copy Markdown
Member

Stacked on #4745 (e2e/settings-check-now-after-failed-install, head c6174cafd merged into this branch); depends on #4745 landing. Only evals/specs/background-desktop-update.e2e.test.ts changes beyond that merge.

Root cause

Session AE's resync of #4745 flagged it in #4745 (comment) (the "⚠️ Flag" paragraph): dev's #4761 switches Check automatically off before the install-failure loop, so returnToApp() (focus + online + 16 min) can no longer trigger an automatic check regardless of the error/install skip that #4745 adds to electron-updater-state.ts. The checks: index + 6, downloads: index + 3 assertion after the failed install held only because the switch was off — the product guard's coverage had become prose.

What changed (spec only)

The switch-off moves from before the loop to inside iteration 0, right after the guard assertion, so every existing step from #4761 and #4745 still runs, in this order:

  1. Branding is applied (unchanged); the loop still asserts the branded Restart Studio? three times.
  2. Iteration 0 — automatic checks ON. After the first failed install the spec asserts automaticChecksEnabled: true (the trigger is armed), calls returnToApp(), opens Settings, sees Couldn't install the update, and asserts checks: 6, downloads: 3 unchanged — now observed against the guard. Then it clicks Check automatically off and asserts automaticChecksEnabled: false, checks: 6, downloads: 3, and continues with Check now → re-download → Restart to update.
  3. Iteration 1 and the final install — automatic checks OFF, exactly dev's isolated flow (automaticChecksEnabled: false is asserted on the second failure).

No assertion was loosened, no wait added, no world change. The world's fake bridge (fails install attempts 1 and 2, installs on 3) and all counters are unchanged.

Proof

Green (this branch) — OPENWORK_EVAL_REF=dff560b428cd34682562d77948f4c33efc9c4161 pnpm evals:e2e background-desktop-update --daytona

  • placement: daytona (--daytona) · [openwork/testkit] ==> source verified dff560b428cd34682562d77948f4c33efc9c4161
  • 3 passed / 0 failed / 0 skipped (verdict: passed): revoked-version 261 s, background/persistent-restart 140 s, relaunch-recovery 278 s.
  • Test-1 trace (evals/results/test-runs/2026-09-10T17-33-24-651Z-…, gitSha dff560b): see(text=Restart Studio?) ×3, the failed restart dismisses its dialog ×2, see(text=Couldn't install the update) ×2, click(label=Check automatically) ×1 (after the first Couldn't install), the user re-downloads after the failed install through Settings ×2.
  • All sandboxes deleted by the harness.

Red without #4745's product change (control) — same local spec, app built at origin/dev 2ed12f72d7d1b434b539dde5361db2204d76036a (which has no error/install guard; nothing committed for this run): OPENWORK_EVAL_REF=2ed12f72d… pnpm evals:e2e background-desktop-update --daytona

  • ==> source verified 2ed12f72d7d1b434b539dde5361db2204d76036a · 2 passed / 1 failed / 0 skipped.
  • Test 1 failed at the new step, spec line 144: Timed out after 30000ms seeing text=Couldn't install the update with the Settings page showing Downloading update… / 0% — i.e. returnToApp() fired an automatic check and re-downloaded after the failed install. The revoked and recovery tests passed.

Earlier run at the same sha (dff560b, first attempt): 2 passed / 1 failed — test 1 (the guard step) and the revoked test passed; the untouched recovery test failed on its second send() right after switching to the "Keep stopped after update" session (Typed field did not retain the expected value, route matched in 21 ms then the composer dropped the typed text). Re-run at the same sha passed 3/3 (above); the control run at dev also passed that test. Listed below, not touched here.

pnpm --filter @openwork/app typecheck exit 0; pnpm --dir evals exec tsc --noEmit -p tsconfig.json reports no errors in this spec (the pre-existing evals baseline errors are unchanged).

Noticed, not touched

  • background-desktop-update recovery test: one-off composer session-switch race — click("Keep stopped after update") → probe.hash() matched immediately → type(composer, …, { verify: true }) failed to retain the text within 5 s. Suggests the composer draft is reset when the freshly selected session finishes loading; the spec has no readiness gate between route match and typing.
  • The local test-run.json records gitSha of the local checkout, not the sandbox app ref; for control runs the sandbox ref is only in the source verified log line.

…on dismiss

Base UI keeps a dialog popup mounted (and partially opaque) until its exit
animation or transition finishes, so the restart prompt and the command
palette stayed visible for 100-200 ms after Keep working / Escape. Hide the
popup with display:none as soon as it is closed; Base UI then unmounts it on
the next frame.
After a failed install the updater status is error/install, which the
automatic check treated like idle: the next focus/online/interval trigger
(or an effect re-run once the 15-minute window had passed) re-checked,
auto-downloaded the same update and left Settings' Check now disabled
behind "Downloading update…". The update is already downloaded, so a
background re-check cannot fix an installer failure; keep the failure and
let the person retry from Settings.
…ownload loop

Return to the app after the check interval before retrying from Settings,
and assert Settings still shows the install failure with no new download.
Apply the custom branding only for the final confirmed restart: the eval's
dev-bridge branding does not survive the Den settings sync that opening
Settings performs for a signed-out app (the failure loop visits Settings).
…led-install' into e2e/updater-guard-coverage-after-4761
…c checks on

The first failed install and its returnToApp() now run with Check
automatically still on, so the counters staying at checks 6 / downloads 3
is observed against the updater's error/install guard rather than the
disabled switch. The switch is turned off right after, so the second
retry and the final install keep #4761's isolation.
@vercel

vercel Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
openwork-app Ready Ready Preview Sep 11, 2026 4:04am UTC
openwork-den Ready Ready Preview Sep 11, 2026 4:04am UTC
openwork-diagnostics Ready Ready Preview Sep 11, 2026 4:04am UTC
openwork-landing Ready Ready Preview, v0 Sep 11, 2026 4:04am UTC

@github-actions

github-actions Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Warden review summary — Clear

Native findings: 0. Blocking policy matches before consolidation: 0. Full finding text remains in Warden's native checks and review threads. This comment retains only native IDs, severity, skill attribution, and safe locations. Analysis run

Reported trigger coverage (not proof of complete repository or context coverage): diff-security-review (6577 ms), confidentiality-review (4841 ms), spec-provenance-review (18023 ms).

Blockers

  • None.

Advisories

  • None.

Needs recheck

  • None.

Observed review-thread metrics

  • Unique observed run attempts in retained window: 2
  • Distinct heads in retained window: 2
  • Current unresolved Warden threads: 0 of 0 observed
  • Observed resolved/unresolved transitions in retained snapshots: 0 / 0
  • First observed resolved/unresolved (state at first collection, not event time): 0 / 0
  • Precision: unavailable (no adjudications; no TP/FP values are inferred)
  • Observation window: 2/20 run attempts retained; truncated: false
  • Transition snapshot: 0/0 current attributed threads retained (limit 500); truncated: false

Thread states are read-only collection snapshots. These metrics are neither lifetime totals nor exact resolution times, and this summary is not clearance authority.

diff-warden[bot]
diff-warden Bot previously approved these changes Sep 10, 2026

@diff-warden diff-warden Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (dff560b428cd34682562d77948f4c33efc9c4161). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run

@github-actions

github-actions Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Passed · 12/12 tests · 18/18 assertions · 8 images

Commit 9811f868e5eb5a27151c3c18f98eeea724791d1f · selected evidence

Open review report

Resolves evals/specs/background-desktop-update.e2e.test.ts after #4745 was
squash-merged to dev (a7748b2): keep this PR's version, which is a superset of
#4745 and #4761 and adds only its own step (automatic checks stay on through the
first failed install, asserted, then are switched off inside iteration 0). The
merged tree differs from dev in this spec only.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

Deploying openwork with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9811f86
Status: ✅  Deploy successful!
Preview URL: https://3c6373cd.openwork.pages.dev
Branch Preview URL: https://e2e-updater-guard-coverage-a.openwork.pages.dev

View logs

@diff-warden diff-warden Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (9811f868e5eb5a27151c3c18f98eeea724791d1f). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run

@yomgui

yomgui commented Sep 11, 2026

Copy link
Copy Markdown
Member Author

Resynced with dev — merge commit 9811f868e5eb5a27151c3c18f98eeea724791d1f

Merge of origin/dev @ 429079c32 (signed, no rebase/force). Parents: dff560b42 (PR head) + 429079c32. Needed because #4745 was squash-merged (a7748b2c8) while this branch carries #4745's original commits plus its own step.

Conflict — evals/specs/background-desktop-update.e2e.test.ts, two hunks inside the install-failure loop; this PR's version kept in both. Verified with git diff origin/dev -- evals/specs/background-desktop-update.e2e.test.ts: the only difference from dev is this PR's own step — the pre-loop switch-off (openSettings → click Check automatically → automaticChecksEnabled:false → openWorkspace) is replaced by the automaticChecksEnabled: index === 0 assertion after each failed install and the if (index === 0) { click Check automatically; expect automaticChecksEnabled:false, checks:6, downloads:3 } block after the guard assertion. #4745's returnToApp → openSettings → Couldn't install → checks: index+6, downloads: index+3 and #4761's flow are present exactly once. git diff origin/dev --stat = this one file, 12+/7−.

Verification on 9811f868e

  • pnpm --dir evals typecheck → 0 errors in this spec; 420 pre-existing errors, identical set to a clean origin/dev @ 429079c32 control worktree.
  • Daytona: OPENWORK_EVAL_REF=9811f868e… pnpm evals:e2e background-desktop-update --daytona → 3 passed / 0 failed / 0 skipped, exit 0 (revoked 266 s, background/persistent-restart 151 s, relaunch-recovery 256 s). {"…"daytona":true,"placement":"daytona","engine":"legacy","surface":"legacy",…,"sandboxRef":"9811f868e5eb5a27151c3c18f98eeea724791d1f","sandboxSha":"9811f868e5eb5a27151c3c18f98eeea724791d1f","refMismatch":false,"passed":3,"failed":0,"skipped":0,"skips":[],"verdict":"passed"}; source verified 9811f868e… ×3; all sandboxes deleted by the harness.
  • Test-run trace for the persistent-restart test (gitSha 9811f868e): see(text=Restart Studio?) ×3, see(text=Couldn't install the update) ×2, click(label=Check automatically) ×1 at seq 54 — directly after the first Couldn't install the update (seq 52) and before Check now — the user re-downloads after the failed install through Settings ×2.

This branch was successfully deployed

4 active deployments
Preview – openwork-landing — 9811f868 Deployed Sep 11, 2026 by vercel[bot]
Preview – openwork-app — 9811f868 Deployed Sep 11, 2026 by vercel[bot]
Preview – openwork-den — 9811f868 Deployed Sep 11, 2026 by vercel[bot]
Preview – openwork-diagnostics — 9811f868 Deployed Sep 11, 2026 by vercel[bot]
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