Repository navigation
fix: pin x-picnic-agent to app 1.206.1 (2.0.4) - #82
Merged
Merged
Conversation
- 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 Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
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.
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), sosearch()andget_article()fail with a non-JSONPicnicAPIError.Measured against the live NL storefront (search page, by agent version):
SearchResult.from_page{"body": ...}PML{"script", "layout"}wrapper1.223 also gets the price of
s1016222wrong (719 instead of 799). 1.206.1 parses every field correctly and is the real app header shipped up to 2.0.2.Changes:
_PICNIC_AGENTto30100;1.206.1-#15408, with a comment on the cutoffs.Verified: unit tests (80 passed), ruff clean,
uv buildOK. Live NL: search melk/koffie/brood (105/339/133 items) andget_article(..., add_category=True)fors1016222(799, "Regular") ands1001546(719, original 959). DE not tested live.This is a stopgap: Picnic will eventually reject old agents. RSC support is on
fix/rsc-pages.