Skip to content

fix: pin x-picnic-agent to app 1.206.1 (2.0.4) - #82

Merged
codesalatdev merged 2 commits into
mainfrom
fix/pin-picnic-agent
Dec 5, 2026
Merged

codesalatdev merged 2 commits into
mainfrom
fix/pin-picnic-agent

Conversation

@codesalatdev

Copy link
Copy Markdown
Owner

2.0.3 sends x-picnic-agent: 30100;1.252.0-#15626;. For that agent the NL storefront serves /pages/* as React Server Components (text/x-component), so search() and get_article() fail with a non-JSON PicnicAPIError.

Measured against the live NL storefront (search page, by agent version):

Agent Response SearchResult.from_page
1.206.1 – 1.223 classic {"body": ...} PML 105 items for "melk"
1.224 – 1.246 {"script", "layout"} wrapper 0 items
1.247+ RSC unparseable

1.223 also gets the price of s1016222 wrong (719 instead of 799). 1.206.1 parses every field correctly and is the real app header shipped up to 2.0.2.

Changes:

  • Pin _PICNIC_AGENT to 30100;1.206.1-#15408, with a comment on the cutoffs.
  • Bump version to 2.0.4.

Verified: unit tests (80 passed), ruff clean, uv build OK. Live NL: search melk/koffie/brood (105/339/133 items) and get_article(..., add_category=True) for s1016222 (799, "Regular") and s1001546 (719, original 959). DE not tested live.

This is a stopgap: Picnic will eventually reject old agents. RSC support is on fix/rsc-pages.

- Agents from 1.224 get /pages/ responses the PML parsers cannot read:
  a {"layout", "script"} wrapper (1.224-1.246, search returns no items)
  and React Server Components from 1.247. 1.206.1 still gets the classic
  page JSON and is the header shipped up to 2.0.2.
@codecov

codecov Bot commented Dec 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.68%. Comparing base (dfd9989) to head (687273c).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #82   +/-   ##
=======================================
  Coverage   94.68%   94.68%           
=======================================
  Files          15       15           
  Lines         659      659           
=======================================
  Hits          624      624           
  Misses         35       35           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@codesalatdev
codesalatdev merged commit 9205a44 into main Dec 5, 2026
4 checks passed
@codesalatdev codesalatdev added the bug Something isn't working label Dec 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant