Skip to content

Conversation

@eduardoformiga
Copy link
Member

What's the purpose of this pull request?

Ajuste para verificar se o shippingData precisa ser atualizado mesmo quando não há mudanças nos itens.

Antes, o código retornava null sem verificar o shippingData quando changes.length === 0, o que podia deixar o shippingData desatualizado e causar loops.

Agora:
Verificamos se o shippingData precisa ser atualizado antes de retornar null.
Se não houver mudanças nos itens, mas o shippingData precisar ser atualizado, atualizamos apenas o shippingData sem chamar updateOrderFormItems.
Isso evita atualizações desnecessárias e reduz a chance de loops.

- Added logic to check if shippingData needs to be updated based on session information.
- Improved flow to return null only if there are no item changes and no shipping updates required.
- Separated item updates and shipping data updates for better clarity and performance.
@eduardoformiga eduardoformiga requested a review from a team as a code owner January 13, 2026 23:46
@eduardoformiga eduardoformiga requested review from emersonlaurentino and renatomaurovtex and removed request for a team January 13, 2026 23:46
@coderabbitai
Copy link

coderabbitai bot commented Jan 13, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

@eduardoformiga eduardoformiga requested review from hellofanny and removed request for emersonlaurentino January 13, 2026 23:46
@codesandbox-ci
Copy link

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.

@eduardoformiga eduardoformiga changed the title refactor: enhance validateCart logic to handle shipping data updates fix: validateCart loop - handle shipping data updates Jan 13, 2026
@hellofanny
Copy link
Contributor

valeuu! Eu testei só com essas mudanças mas o erro persistiu depois da segunda tentativa, não consegui commitar nessa branch, então criei uma nova adicionar mais uma verificação: #3174 🙏

@hellofanny hellofanny closed this Jan 14, 2026
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.

3 participants