fix: improve cancellation message when order expires#539
fix: improve cancellation message when order expires#539Deepak8858 wants to merge 1 commit intoMostroP2P:mainfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
WalkthroughThe PR modifies order state handling to distinguish timeout-based cancellations from user-initiated ones. When an order's status is marked as expired in the payload, it now returns Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~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 unit tests (beta)
📝 Coding Plan
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 Tip You can enable review details to help with troubleshooting, context usage and more.Enable the |
Catrya
left a comment
There was a problem hiding this comment.
Hey, thanks for working on this! I took a look at the PR and I think there's an issue with the approach.
The fix checks for payloadStatus == Status.expired when an Action.canceled is received, but when an order expires due to counterparty inactivity, Mostro sends
Action::Canceled with None as the payload, it never sends Status::Expired in the payload. So message.getPayload<Order>()?.status will always be null in this scenario, and the condition on line 300 will never be true.
The message will still always fall through to the regular "You have canceled the order" text, which is exactly the problem we're trying to fix.
Did you get a chance to test this locally against a running Mostro instance?
|
Hello @Deepak8858 this PR will be closed due to inactivity regarding the requested changes. Feel free to reopen it if you wish to continue working on it or to start a new one. Thank you for your interest in collaborating on the project. |
Improves the cancellation message shown to the user when an order expires due to counterparty inactivity. Instead of saying 'You have canceled the order', it now says 'The counterparty did not respond in time. The order has been canceled.' if the order status is expired.\n\nFixes #532
Summary by CodeRabbit