fix(api): use account-scoped cookie in orderEntry headers#3395
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughFive ChangesorderEntry Header Construction Refactor
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/api/src/platforms/vtex/clients/commerce/index.ts`:
- Around line 902-905: Remove redundant header definitions across the three
methods startOperation, createOrderForm, and getOrderFormItems. Since autHeaders
already contains lowercase 'content-type' and 'X-FORWARDED-HOST', locate each
place where autHeaders is spread and an uppercase 'Content-Type' header is added
separately, and remove that redundant 'Content-Type' property. Additionally, in
createOrderForm and getOrderFormItems, remove the redundant 'X-FORWARDED-HOST'
header that duplicates what is already in autHeaders. Simply spread autHeaders
directly without adding these duplicate headers.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: f3f5c33d-894e-4cab-a2a8-7722e6d2ca91
📒 Files selected for processing (1)
packages/api/src/platforms/vtex/clients/commerce/index.ts
@faststore/api
@faststore/cli
@faststore/components
@faststore/core
@faststore/diagnostics
@faststore/lighthouse
@faststore/sdk
@faststore/ui
commit: |
|
## Summary Graduate the `4.3.0-dev.8` prerelease cycle to the stable `4.3.0` release on `latest`. Merging this PR triggers CD on `main`, which runs `lerna version --conventional-graduate` and publishes all `@faststore/*` packages to the `latest` dist-tag. ### Features - Password Protection (v4) (#3276) - File upload via Order Entry Service (OES) (#3334) - Add sitemap to CMS Landing Page content-type (#3386) ### Bug Fixes - **core:** use authenticator route for setpassword (#3380) - migrate partytown `@builder.io` → `@qwik.dev@0.14.0` (#3394) - **api:** use account-scoped cookie in orderEntry headers (#3395) - forward auth token only via account-scoped cookie (#3381) - **core:** propagate upstream error status instead of always 500 (#3379) ## Pre-flight (faststore-release skill) - Working tree clean; `release.yml` has `fetch-depth: 0` - All 8 packages have `repository.url` - No breaking changes since `v4.2.0` - `dev → main` merges cleanly (no CHANGELOG/codegen conflicts) - No unmerged hotfixes on `main` (accidental `4.2.1` was fully reverted in #3375) ## Test plan - [ ] CI green on this PR - [ ] After merge, confirm CD publishes all 8 packages at `4.3.0` under `latest` Made with [Cursor](https://cursor.com) --------- Co-authored-by: Matheus P. Silva <cout.matheusps@gmail.com> Co-authored-by: vtexgithubbot <vtexgithubbot@github.com> Co-authored-by: Lucas Feijó <lucas.portela@vtex.com> Co-authored-by: Luiz Falcão <39093175+llfalcao@users.noreply.github.com> Co-authored-by: Artur Santiago <artur.santiago@cubos.io> Co-authored-by: Larícia Mota <laricia.mota@vtex.com.br> Co-authored-by: Sahan Jayawardana <sahan@clouda.io> Co-authored-by: Mateus Pontes <mateuspo10@gmail.com> Co-authored-by: Matheus Martins <mathews_2010@outlook.com> Co-authored-by: renatomaurovtex <167437775+renatomaurovtex@users.noreply.github.com> Co-authored-by: Leandro Rodrigues <leandro.rodrigues@vtex.com> Co-authored-by: Fanny Chien <fanny.chien@vtex.com> Co-authored-by: Arthur Andrade <arthurfelandrade@gmail.com> Co-authored-by: Leandro Rodrigues <leandro.swf@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Thiago Pereira <thiago.pereira@vtex.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Giuliana Rigaud <62848434+giurigaud@users.noreply.github.com> Co-authored-by: renato <renato.neto@cubos.io> Co-authored-by: Bruna Santos <brunassdev@gmail.com> Co-authored-by: BrunaCubos <104789782+BrunaCubos@users.noreply.github.com> Co-authored-by: Ícaro Oliveira <icarovinici@gmail.com> Co-authored-by: Bruna Santos <bruna.santos@cubos.io> Co-authored-by: Everton Ataide <everton.ataide@vtex.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Otavio Moreira Meirelles <otavio.meirelles@vtex.com> Co-authored-by: Marco Cardoso <marcopaulo@outlook.com> Co-authored-by: Gabriel Paladino <gabpaladino@users.noreply.github.com> Co-authored-by: CodeRabbit <noreply@coderabbit.ai> Co-authored-by: dk-portal[bot] <134092483+dk-portal[bot]@users.noreply.github.com> Co-authored-by: Rodrigo Tavares <rodrigo.tavares@vtex.com> Co-authored-by: vitorflg <vitor.gomes@vtex.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: Válber Laux <valber.laux@vtex.com>

0 New Issues
0 Fixed Issues
0 Accepted Issues
What's the purpose of this pull request?
fix(api): use account-scoped cookie in orderEntry headers
The orderEntry methods (file upload via OES, #3334) still referenced the
withAutCookie helper that #3381 removed, since that PR was not rebased on
the latest dev and did not see the newly merged orderEntry block. This
left an undefined withAutCookie reference, breaking the build and tests
on dev.
Replace the 5 withAutCookie(forwardedHost, account) calls with the
withCookie({ 'content-type', 'X-FORWARDED-HOST' }) pattern adopted by
#3381
Summary by CodeRabbit
Content-Typeand forwarded host information.multipart/form-datawith the proper boundary while retaining the updated base header behavior.