-
Notifications
You must be signed in to change notification settings - Fork 3
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(web-components): handle failed offer status updates better #63
Conversation
if (!('error' in update)) { | ||
walletUpdatesNotifierKit.updater.updateState(harden(update.value)); | ||
} |
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.
consider not inverting the condition.
if (!('error' in update)) { | |
walletUpdatesNotifierKit.updater.updateState(harden(update.value)); | |
} | |
if ('error' in update) continue; | |
walletUpdatesNotifierKit.updater.updateState(harden(update.value)); |
onStatusChange({ status: 'refunded' }); | ||
return; | ||
} | ||
if (update.status.numWantsSatisfied === 1) { |
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.
what about multiples? I think this would be future proof and safe enough:
if (update.status.numWantsSatisfied === 1) { | |
if (update.status.numWantsSatisfied > 0) { |
@@ -43,33 +43,53 @@ export const makeAgoricWalletConnection = async (chainStorageWatcher, rpc) => { | |||
}), | |||
); | |||
|
|||
let isFinished = false; |
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.
a little hard to follow all the reads and mutations, but I can't think of anything clearer.
@@ -17,7 +17,7 @@ | |||
"dependencies": { | |||
"@agoric/assert": "^0.6.0", | |||
"@agoric/cache": "^0.3.2", | |||
"@agoric/casting": "^0.4.2", | |||
"@agoric/casting": "0.4.3-dev-0001c49.0", |
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.
it would help to have some process for cleaning up dev
deps whenever a new agoric-sdk release is published. maybe part of the SDK release runbook.
8604ae5
to
8f6b526
Compare
refs #57
Tested in a local build of dapp-inter that this fixes the issue. Will close the issue when this is published and dapp-inter and dapp-psm use the new version.
Screenshot of error properly being shown to user after fix: