-
Notifications
You must be signed in to change notification settings - Fork 212
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
fix(wallet): handle cancelled offer state #4292
Conversation
I wonder if it makes sense to show what assets were actually transferred vs returned inside the "completed" offer. I noticed that even if you were outbid on a card the offer shows "completed" but you didn't actually lose your give/get your want. |
f28bc65
to
d152b49
Compare
This is a good idea, maybe a "refunded" state. Zoe currently doesn't do anything to distinguish this result, so it would take some work on the Zoe service to be able to report it. We could instead hack together something in the wallet backend to heuristically determine that it was a refund (not my preference). @erights, thoughts? |
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! Just one suggestion to make a conditional terser.
const isOfferCompleted = | ||
status === 'accept' || | ||
status === 'decline' || | ||
status === 'complete' || | ||
status === 'rejected' || | ||
status === 'cancel'; | ||
|
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.
const isOfferCompleted = | |
status === 'accept' || | |
status === 'decline' || | |
status === 'complete' || | |
status === 'rejected' || | |
status === 'cancel'; | |
const isOfferCompleted = ['accept', 'decline', 'complete', 'rejected', 'cancel'].includes(status); |
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.
@samsiegart @michaelfig
Where does this status
string come from? Where are its possible values defined?
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.
I'm not sure if we have any good documentation on that. The implementation is in https://github.com/Agoric/agoric-sdk/blob/master/packages/wallet/api/src/lib-wallet.js (search for "status:")
Will merge to fix #4243, we can continue the discussion here or open an issue if need be |
Fixes: #4243
Screenshot: