Skip to content

fix(producer): the catalog payload check passes when Google Fonts drops a connection - #9109

Merged
miguel-heygen merged 3 commits into
mainfrom
fix/catalog-payloads-offline-fonts
Nov 30, 2026
Merged

miguel-heygen merged 3 commits into
mainfrom
fix/catalog-payloads-offline-fonts

Conversation

@miguel-heygen

Copy link
Copy Markdown
Collaborator

What

The Catalog payloads check no longer fails when Google's font hosts drop a connection. Its browser answers fonts.googleapis.com and fonts.gstatic.com itself, with an empty stylesheet or font, so a payload that loads passes whether or not those hosts answer.

Why

The check went red on two release PRs for payloads that load fine: caption-emoji-pop: request failed: https://fonts.gstatic.com/s/gabarito/v9/….woff2 (net::ERR_CONNECTION_CLOSED) plus its console.error twin, and a rerun of the same commit passed. Every failed request counts, so any blip on Google's side failed the job. A font only changes how text looks; it can't make a payload throw or lose an asset.

Related work

None.

How

  • checkPageLoads (packages/producer/src/verifyStaticPage.ts) pauses only requests to the two Google font hosts (CDP Fetch with those two URL patterns) and fulfils them with a 200 and an empty body. Every other request goes out as before, so a missing script, image or media file on any host still fails the check.
  • What this gives up: a Google Fonts URL naming a family that doesn't exist is no longer caught here. The page falls back to the next font in its stack.
  • Still live: scripts from cdn.jsdelivr.net (gsap is in 390 of 448 payloads) and a few others, about 30 outside URLs in all. A release PR re-checks every payload that drifted since the last catalog publish, so if a blip on one of those hosts ever fails this job, the next step is to serve those files to the check from local copies.

Test plan

fails without the fix: scripts/verify-catalog-payloads.test.ts ("passes a payload's Google Fonts"). It loads a page with a Google Fonts <link>, an @import and a fonts.gstatic.com @font-face while Chrome cannot reach either host, and expects no failures. On main it reports six (each request plus its console error); here none. Dropping only the fonts.gstatic.com pattern turns it red again. The second new test ("still fails a script whose host is unreachable") keeps a script from an unreachable host counted.

  • Unit tests added/updated. The whole file passes 3 runs in a row; verifyStaticPage.test.ts passes; producer type check passes.
  • Manual testing performed. verify:catalog-payloads --only caption-emoji-pop with Chrome unable to reach Google's font hosts: main fails with the two lines CI showed, this branch passes. Every payload (439 live, 9 markers) in the Chrome 155 build puppeteer pins, run with main's code and with this branch's: with Google's font hosts unreachable, main fails 61, each on a Google Fonts request, and this branch fails none; with the network as is, both pass all 439 with the same verdicts.
  • Documentation updated: none needed.
  • Comments follow CONTRIBUTING.md "Comments".

@github-actions

github-actions Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Edit accuracy: accurate 275 (base branch 273), smooth 66 of those

The gate passes.
Smoothness is reported in the artifact, not gated. A case fails only if it fails 2 of 3 runs.

Newly passing (2)

  • seqscaletwice-scale-px-r0-root-z100
  • seqscaletwice-scale-px-r0-nested-z100

Not banked yet, reported and not gated (bank a full-grid run's baseline.json) (2)

  • seqscaletwice-scale-px-r0-root-z100
  • seqscaletwice-scale-px-r0-nested-z100

Quarantined, measured but not gated (0)

@terencecho terencecho 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.

[P2] Keep non-font requests visible to the Catalog check. packages/producer/src/verifyStaticPage.ts:91 intercepts every HTTPS request to the two hosts, regardless of resource type. A missing image on either host can now receive an empty HTTP 200, which the request and response handlers treat as success. Limit the patterns to stylesheet requests on fonts.googleapis.com and font requests on fonts.gstatic.com, and pin the same-host non-font case alongside the existing other-host test.

[P2] Close the page if interception setup fails. packages/producer/src/verifyStaticPage.ts:55 sets up CDP before the page’s try/finally. Both setup rejection paths skip page.close() in a focused fault-injection check. Move setup inside the existing try so checkPageLoads closes the page on every exit after creation.

The Catalog payload and support jobs passed, including both new browser cases.

— tai (automated review)

@miguel-heygen

Copy link
Copy Markdown
Collaborator Author

Both fixed in 022ce1e.

  1. Only Google's stylesheets and font files are answered now: Fetch.enable takes resourceType: "Stylesheet" for fonts.googleapis.com and resourceType: "Font" for fonts.gstatic.com (verifyStaticPage.ts:92-93). Any other request to those hosts goes out and counts as before. New test: "still fails an image on Google's font host" (an <img> on fonts.gstatic.com with the host unreachable must fail). It fails on d0de16e and passes here.
  2. The interception is set up inside the try, so page.close() runs on every exit once the page exists (verifyStaticPage.ts:56). New test: "closes the page when answering the font hosts cannot be set up" (a page whose CDP session rejects). It fails on d0de16e and passes here.

scripts/verify-catalog-payloads.test.ts passes 13 of 13, 3 runs in a row. Every payload in puppeteer's Chrome 155 with Google's font hosts unreachable: 439 of 439 live payloads pass, as before the change.

@terencecho terencecho 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.

Both earlier findings are resolved. The browser stubs only stylesheet requests to fonts.googleapis.com and font requests to fonts.gstatic.com. The page closes when interception setup fails. I verified the same-host image failure in Chrome and injected failures at both setup steps to check cleanup. The PR body names the test that fails without the fix.

— tai (automated review)

@miguel-heygen
miguel-heygen added this pull request to the merge queue Nov 30, 2026
Merged via the queue into main with commit 78ee605 Nov 30, 2026
102 checks passed
@miguel-heygen
miguel-heygen deleted the fix/catalog-payloads-offline-fonts branch November 30, 2026 06:02
@miguel-heygen miguel-heygen mentioned this pull request Nov 30, 2026
4 of 5 tasks
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.

2 participants