-
Notifications
You must be signed in to change notification settings - Fork 149
refactor: streamline order progress state management and enhance tests #6511
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…d hooks and tests
elena-zh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you!
apps/cowswap-frontend/src/modules/orderProgressBar/hooks/useOrderProgressBarProps.ts
Show resolved
Hide resolved
apps/cowswap-frontend/src/modules/orderProgressBar/hooks/useOrderProgressBarProps.ts
Show resolved
Hide resolved
apps/cowswap-frontend/src/modules/orderProgressBar/hooks/useOrderProgressBarProps.ts
Show resolved
Hide resolved
|
@fairlighteth nice work, thank you! |
Summary
Fixes #6509
Keeps cancellation-triggered orders in the progress-bar store while the confirmation modal is still referencing them, so the “Cancellation failed / oops” banner can render reliably. The updater now unions the tracked IDs from pending orders, surplus queue, confirmation hash, and cancellation flags via a dedicated selector, and all updaters short-circuit until a real
orderIdexists to avoid infinite render loops. Added regression coverage for both the selector and updater.To Test
Reproduce the cancel-during-execution flow
Regression check for solver info (from PR fix: keep displayed orders in progress state and dedupe favicon completions #6510)
Background
The favicon update (#6358) introduced aggressive pruning that removed progress-bar state as soon as an order left the pending list. PR #6510 kept solver data alive by extending the tracked set; this follow-up carries the same retention logic over to cancellation attempts and hardens the progress-bar updaters so they only touch Jotai state once an order ID exists, eliminating the max-depth loops we hit while testing.