Repository navigation
Wait for the product grid before the DOM price cross-check - #17
Merged
Merged
Conversation
Category pages now paint a 19-tile carousel about a second before the grid. The readiness wait counts any tile, so the cross-check could read only the carousel, match none of page 1's rows and record checked=0, which turned the daily canary red on 2026-10-13. It now waits (bounded, 10 s) until a rendered tile carries one of the page's stockcodes, and warns if none does. Adds a real two-read capture of the bakery page as a fixture. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The daily canary went red on 2026-10-13 (run 38483372156) with
dom_confirm = {tiles: 19, checked: 0, confirmed: 0}. That run itself exited 0 with 109 correct rows. The next scheduled run (2026-10-14, same commit) passed with 60 tiles and 41 checked, so the failure comes and goes.Diagnosis, measured live on 2026-10-15 (headful Chromium under Xvfb, no proxy, no key):
/shop/browse/bakerynow paints a 19-tile horizontal carousel (seasonal products) about one second before the 37-tile product grid. Tile counts polled every 250 ms went 0 → 19 → 52 → 56.wc-product-tile, so the 19 carousel tiles satisfy it.confirm_with_domreads only the carousel. It then checks 0 rows and logs that at INFO only.A capture taken in that gap reproduces the canary's numbers exactly: 19 tiles, 0 checked. A later read in the same session gives 37/37.
Change
product_parser.rows_with_a_tile(rows, tiles): how many rows have a rendered tile with their own stockcode.page_flow.confirm_with_dom: when tiles are on screen but none matches the page's rows, it re-reads them every 500 ms for up toGRID_SETTLE_MS(10 s) until the grid shows up. If nothing ever matches, it logs a WARNING naming the tile count. Rows are never changed by this path.tiles_carousel_first: a real capture from one session. It holds the carousel-only read (19 tiles), the full read (56 tiles), and page 1 of the category API that the page's own UI requested, trimmed the same way as the other listing fixtures.make_fixtures.pydocuments and builds it.Evidence
page_flow.pyrestored frommainand the new fixture and tests kept,test_dom_confirmation_waits_past_a_carousel_for_the_gridfails. The cross-check reads the carousel and stops at checked 0, and the give-up test errors.(0, 0). The late read gives(8, 8). Pinned skus and prices are6041394$4.00,49622$5.20 and6037735$2.60.19 tile(s) had painted…then37 of 37 row(s) checked against 56 rendered tile(s). Result: 109 rows, exit 0.Not changed
🤖 Generated with Claude Code