Skip to content

test-app(telemetry): e2e pipeline spec - #102

Open
a-d-j-i wants to merge 4 commits into
feat/sw-telemetry-executorfrom
test/sw-telemetry-executor
Open

a-d-j-i wants to merge 4 commits into
feat/sw-telemetry-executorfrom
test/sw-telemetry-executor

Conversation

@a-d-j-i

@a-d-j-i a-d-j-i commented Oct 31, 2026

Copy link
Copy Markdown
Collaborator

sw-telemetry.spec.ts covers the full telemetry pipeline against the telemetry-manifest*.json fixtures introduced earlier in the stack:

  • Tampered subresource → batched POST at the manifest-sourced events endpoint; config-fallback URL stays empty.
  • Tampered subresource in REPORTING mode → event ships without redirecting to the warning page.
  • Tampered manifest → MANIFEST_UNTRUSTED verdict shipped via the cached manifest URL.
  • Priority (violation) short-circuits the ceiling and ships quickly.
  • Cold-start manifest 500 → events ship to the config fallback URL.
  • Batching aggregates: multiple events share a single POST.
  • Unsent batches ship once the endpoint recovers.
  • 500-survival observational probes (gated by RUN_SURVIVAL_TESTS).
  • Exponential backoff + merged recovery (gated by RUN_RETRY_TESTS).

@a-d-j-i
a-d-j-i added this pull request to stack #95 October 31, 2026 13:38
@a-d-j-i
a-d-j-i force-pushed the test/sw-telemetry-executor branch from 944fa02 to 2785ee0 Compare November 2, 2026 18:51
@a-d-j-i
a-d-j-i marked this pull request as ready for review November 3, 2026 15:05
@a-d-j-i
a-d-j-i force-pushed the test/sw-telemetry-executor branch from 2785ee0 to ce48596 Compare November 3, 2026 15:39
@a-d-j-i
a-d-j-i force-pushed the test/sw-telemetry-executor branch from ce48596 to a974a93 Compare November 5, 2026 11:54
@a-d-j-i
a-d-j-i requested a review from a team as a code owner November 5, 2026 11:54
@a-d-j-i
a-d-j-i force-pushed the test/sw-telemetry-executor branch 2 times, most recently from 111f4b6 to 356e366 Compare November 5, 2026 18:08
@a-d-j-i
a-d-j-i force-pushed the test/sw-telemetry-executor branch from 356e366 to 6fc1edf Compare November 16, 2026 15:10
@netlify

netlify Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for dappfence-templates ready!

Name Link
🔨 Latest commit 17f8323
🔍 Latest deploy log https://app.netlify.com/projects/dappfence-templates/deploys/6b1307a2584f9e84004f7b79
😎 Deploy Preview https://deploy-preview-102--dappfence-templates.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@a-d-j-i
a-d-j-i force-pushed the test/sw-telemetry-executor branch 2 times, most recently from 3792e72 to bcaec21 Compare November 16, 2026 17:06
@a-d-j-i
a-d-j-i force-pushed the test/sw-telemetry-executor branch from bcaec21 to 4d91758 Compare November 17, 2026 13:50
@a-d-j-i
a-d-j-i removed this pull request from stack #95 November 17, 2026 14:27
@a-d-j-i
a-d-j-i added this pull request to stack #112 November 17, 2026 14:27
@a-d-j-i
a-d-j-i force-pushed the test/sw-telemetry-executor branch from 4d91758 to b9fa861 Compare November 18, 2026 18:03
@a-d-j-i
a-d-j-i force-pushed the test/sw-telemetry-executor branch from b9fa861 to 955ab9e Compare November 27, 2026 16:35
sw-telemetry.spec.ts covers the full telemetry pipeline against the
telemetry-manifest*.json fixtures introduced earlier in the stack:

- Tampered subresource → batched POST at the manifest-sourced events
  endpoint; config-fallback URL stays empty.
- Tampered subresource in REPORTING mode → event ships without
  redirecting to the warning page.
- Tampered manifest → MANIFEST_UNTRUSTED verdict shipped via the cached
  manifest URL.
- Priority (violation) short-circuits the ceiling and ships quickly.
- Cold-start manifest 500 → events ship to the config fallback URL.
- Batching aggregates: multiple events share a single POST.
- Unsent batches ship once the endpoint recovers.
- 500-survival observational probes (gated by RUN_SURVIVAL_TESTS).
- Exponential backoff + merged recovery (gated by RUN_RETRY_TESTS).
Add catch-all `/` CSP entry so index.html's inline scripts are covered
by the default manifest. Tests that wanted "no csp.pages entry"
behavior move to a dedicated no-csp-entries.html + manifest (nested
describe in sw-csp.spec.ts). Adds report-uri assertion.

Telemetry e2e: scaffold telemetry.html pages with
EVENTS_ENDPOINT_ATTR slot.

Supporting fixes for the CSP story:
- assets/app.js: inline onclick → addEventListener.
- sw/main.js: skip respondWith for destination="report" fetches (CSP
  reports are no-cors + redirect:error, can't be forwarded).
- manifest-tools/inline-scripts.js: decode HTML entities in attribute
  values before hashing.
Extends sw-telemetry.spec.ts for the split event/log channels:
- captureSwConsole: attaches console listeners to current + future SWs so
  install-time log lines land in the buffer; tags each line with swUrl to
  distinguish coexisting SWs during capture-mode handover
- readSettingsKey: direct IDB probe for a specific settings key, needed
  because the executor now stores EVENTS_RETRY_STATE_KEY and
  LOGS_RETRY_STATE_KEY out-of-line (same shape, so getAll can't tell
  them apart)

Adds sw-dappfence-cache-miss.spec.ts: reproduces the ERR_CACHE_MISS
DevTools entry seen on first-load-after-restart when the SW re-intercepts
/dappfence.js. The CORS upgrade in prepareRequest puts the rebuilt Request
in a different cache partition than the original <script>-tag load, so
the browser shows the red Network entry even though the outer fetch
succeeds and the page loads.
…rity

Playwright captures every console emission via sw.on('console',...), so
`logger.local.*` lines land in the console tally even though they
deliberately skip the telemetry buffer. The console→wire 1:1 assertion
then fails any time a `.local` line fires during the run (e.g. the new
"Resolved manifest from cache" trace in manifest-loader).

Fix: pre-filter consoleBodies against an exclusion list. The list
mirrors each `logger.local.*` call site in the SW source 1:1 —
grouped by file, with the exact message prefix per entry. Adding a
new `.local` call means adding a line here; a single grep keeps the
two in sync.

The companion unit test (logger.test.js § `.local.*`) still locks in
the skipBuffer invariant at the module level.
@a-d-j-i
a-d-j-i force-pushed the test/sw-telemetry-executor branch from 955ab9e to 17f8323 Compare December 4, 2026 18:34

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