Skip to content

Automate: HTTPS backup download in WebKit and Firefox, and certificate replacement under an open tab #3426

Open

Description

@VijitSingh97

What's the problem

Only Chromium has an automated proof of a real HTTPS backup download, and the certificate-replacement recovery guidance has no end-to-end test in any engine. In Safari and Firefox the 2.0.0 RC3 and RC4 hand checks are the only proof (owner, 2026-10-12: automate what RC testing did by hand).

  • dashboard/tests/browser/backup-download.test.mjs serves a real archive over HTTPS and checks size, SHA-256, openssl decrypt, gzip -t, members and a single backup POST, but it imports only chromium and mounts the current BackupPanel. The workflow also runs it in Chrome for Testing.
  • backup.test.mjs covers all four Playwright projects over plain HTTP with a synthetic body, because WebKit route interception emits no native download.
  • The 60 s recovery advice after a certificate change (GUI appliance update rotates trusted TLS certificate despite unchanged settled SANs #3414) is tested with a fake clock (dashboard/tests/frontend/app/connectionrecovery.test.mjs), and the appliance leg only greps the served source for the guidance text. No test replaces a certificate under an open tab.

This story is adapted to the new UI (#3566; owner, 2026-10-27: no work in the current dashboard UI, which is deleted at the 2.1.0 cutover, #2547). The tests target Settings > Backup (#2530, which absorbed #2541) and the new shell's connection recovery (#2513). Related, not duplicates: #3395 and #3396 cover other browser surfaces.

What it impacts

Appliance and DIY users who download a backup in Safari or Firefox, and anyone whose dashboard certificate is replaced (an update, a renewal) while a tab is open. A regression in either path would ship unseen, because the backup holds recovery material that cannot be rebuilt and the recovery guidance is checked only against a fake clock. The change is test-only. The required Browser user journeys check (.github/workflows/browser.yml, make test-browser) gains runtime.

How I found it

Owner request on 2026-10-12 after the RC3 and RC4 hand tests: the emergency kit and then the archive were saved in Chrome and Safari, size and SHA-256 compared with the server copy, decrypted with the kit's passphrase and the members checked. The certificate-replacement guidance under an already-open tab was not exercised live in RC3, and RC4's natural certificate change left the original tab disconnected (#3414, closed in 2.0.1). The coverage list above was re-read on develop-v2.1.0 on 2026-10-27 and still holds.

Further evidence from #3539 (actions run 39274579502): the required Browser user journeys check failed in WebKit at backup.test.mjs:84, waiting for a download event after the kit link click, while the other 263 cases passed. That branch did not touch the backup code or its tests, and no flakiness claim is made.

Not confirmed: whether the new shell (PR #3584, open) carries the #3414 recovery guidance; the diff read on 2026-10-27 shows only the generic Disconnected line. Nothing was run in Firefox or WebKit for this rewrite.

How important is it

Medium. This is test debt on the maintenance & gates track and never blocks a ship (lean roadmap: after the new backup UI is built). The risk is real, since real downloads and the certificate-change recovery are proven only by hand outside Chromium. Cost: M, about 1-2 min of CI per engine (estimate). Workable only after #2530 and #2513 land.

Acceptance criteria

  • For Chromium, WebKit and Firefox, a test clicks Back up now in the new Settings > Backup card against a real HTTPS server, and saves the emergency kit and the archive through the browser's real download path, not route interception.
  • In every engine the saved archive's size and SHA-256 equal the served bytes, the kit's passphrase decrypts it with openssl, gzip -t passes, the members are the expected ones, and exactly one backup POST was sent.
  • One corrupted served byte makes that check fail in all three engines.
  • Chromium keeps the real certificate interstitial clicks. WebKit and Firefox may use ignoreHTTPSErrors, and the test says this proves the download path only, not the certificate-trust UX.
  • Certificate replacement, Chromium only: serve the new shell and a minimal state endpoint over certificate A and load a tab, then restart the server at the same address with certificate B. No recovery guidance shows before 60 s of failed polling on the page clock. At 60 s it shows the fingerprint comparison and the stop-on-mismatch text. After certificate B is accepted in a second tab, the original tab reconnects without a reload. The test is red if the guidance never appears or the original tab needs a reload.
  • Tests of the removed Backup tab are replaced, not kept beside the new ones, and nothing in the current dashboard UI is changed.
  • Any new node --test file is added to testIgnore in dashboard/tests/browser/playwright.config.mjs and to make test-browser, so the required Browser user journeys check runs it. The PR quotes the CI run ids and the added time per engine.
  • The change adds no product control and no explanatory source comments, and any testing documentation that lists the browser backup tests is updated.

Possible solutions

Earlier scope, kept as evidence only (superseded 2026-10-27; do not implement from it)

What's the problem

Automation backlog from 2.0.0 RC manual testing (owner, 2026-10-12: automate what RC testing did by hand).

Manual procedure today
In RC3 and RC4 RC testing saved the emergency kit and then the archive in Chrome and in Safari, compared size and SHA-256 with the server copy, decrypted with the kit's passphrase and checked the members. The certificate-replacement guidance under an already-open tab (fingerprint comparison, stop on mismatch, accept, the original tab reconnects) was not exercised live in RC3, and RC4's natural certificate change left the original tab disconnected (#3414).

Automated today

  • dashboard/tests/browser/backup.test.mjs saves the kit and the archive in all four Playwright projects, but over plain HTTP with a synthetic body (route interception emits no WebKit download, :46): no real archive, hash, decrypt or certificate in WebKit or Firefox.
  • dashboard/tests/browser/backup-download.test.mjs has the HTTPS, hash and decrypt oracle in Chromium only (it imports only chromium, :10; launch at :144-150); the workflow also runs it in Chrome for Testing.
  • The 60 s recovery advice is unit-tested with a fake clock (dashboard/tests/frontend/app/connectionrecovery.test.mjs:8); the appliance leg only greps the served source for the guidance text (tests/os/appliance-address-watch-leg.sh:48-52).

Related, not duplicates
#3395 and #3396 cover other browser surfaces; #3414 is the product fix, accepted on the appliance.

what it impacts

Where it runs
.github/workflows/browser.yml, job "Browser user journeys" (required). make test-browser already runs backup-download.test.mjs with node --test (Makefile:19), and the job already installs chromium, firefox and webkit (browser.yml:31).

How I found it

Discovery details are not separately established in the existing report; preserve and verify the evidence already recorded.

how important is it

Cost
M. About 1-2 min of CI per engine (estimate).

acceptance criteria

Done when

  • Each engine saves both files with matching hashes; one corrupted served byte fails all three.
  • The certificate test is red if guidance never appears or the original tab needs a reload.
  • Registered in make test-browser; CI run ids quoted.

possible solutions

Automate it
Layer: tier-1 browser, dashboard/tests/browser.

  1. Backup in every engine: parametrise backup-download.test.mjs over Playwright webkit and firefox against the same real HTTPS server. Chromium keeps the real interstitial clicks (:160-162); the other engines use the ignoreHTTPSErrors context option because their warning UI differs. Same oracle: size and SHA-256 equal the server bytes (:201-202), openssl decrypt (:203), gzip -t (:222), members (:223-224), one POST (:235).
  2. Certificate replacement, Chromium only (the real interstitial is what is under test): new dashboard/tests/browser/cert-replacement.test.mjs, run with node --test like backup-download.test.mjs, so it must be added to the testIgnore in dashboard/tests/browser/playwright.config.mjs:7 and to make test-browser (Makefile:19). Serve the real dashboard app and a minimal /api/state over certificate A and load it; restart the server on the same port with certificate B; advance the page clock past 60 s; assert the guidance and the fingerprint command render; accept B in a second tab; assert the original tab recovers without a reload. Negative control: no guidance before 60 s.

Activity

  1. added this to the v2.x - post-GA milestone on Oct 12, 2026
  2. added
    dashboard
    testing
    on Oct 12, 2026
  3. pithead-developer commented on Oct 21, 2026

    @pithead-developer
    Contributor

    Parked in Icebox under the lean roadmap (owner, 2026-10-21): this tests a surface that v2.1.0 reshapes, so writing it now means rewriting it; the feature PRs carry their own tests.

  4. pithead-developer commented on Oct 21, 2026

    @pithead-developer
    Contributor

    Additional current-head evidence from pithead#3539 at c12fe747fbb38ce41b71e1dbbfec874435acff77: the required Browser user journeys check failed in WebKit at backup.test.mjs:84, waiting for the kit link click and a download event. The other 263 cases passed. This branch changes integration hardening and its documentation, not the dashboard backup implementation or browser tests. This matches the WebKit route-interception limitation already recorded here; no retry or flakiness claim is being made.

    Run: https://github.com/p2pool-starter-stack/pithead/actions/runs/39274579502/job/118135432400

  5. added
    operator-action
    on Oct 27, 2026
  6. added
    blocked
    and removed
    operator-action
    on Oct 27, 2026
  7. pithead-developer commented on Nov 16, 2026

    @pithead-developer
    Contributor

    Blocked on #2530.

    Parked until the lean UI lands (see the park comment above). The native blocked-by links already hold it, and the tick removes blocked when every listed issue closes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    blockeddashboardtesting

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions