-
Notifications
You must be signed in to change notification settings - Fork 7
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: read beansOwing correctly #95
Conversation
Deploying with Cloudflare Pages
|
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.
Needs a regression test. I'll accept an issue to develop one.
beansOwingUpdater.updateState(Number(value)); | ||
}, | ||
err => { | ||
console.error('error watching beansOwing', err); |
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.
Shouldn't we alert the user to errors like this?
What other failures are being ignored like this was?
Should watchLatest
require an error handler?
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.
Should watchLatest require an error handler?
I think optional is okay, we don't need to mandate that for all consumers
Shouldn't we alert the user to errors like this? What other failures are being ignored like this was?
Good point, I guess it makes sense to do a little more than just log to console (which was the previous behavior). We have an errorHandler
hook that we're passing in which shows a toast and sets the wallet state to an error, hiding purses and stuff. Now that I think about it, it's probably not overkill to do so, because if something went wrong in any part it's probably a big enough deal. Just updated the adapter to call that hook in all cases.
Created #96. The changes to batchQuery.ts will be tested when I move the code to ui-kit |
e781d6f
to
8fd9484
Compare
@@ -321,15 +336,19 @@ export const makeWalletBridgeFromFollowers = ( | |||
value.liveOffers ?? [], | |||
); | |||
}, | |||
err => { | |||
console.error('error watching pending offers', err); | |||
errorHandler(new Error(err)); |
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.
is this because err
isn't necessarily an Error?
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.
Yea it's just a string, which I thought would be more convenient but not in this case
"Current Fees Accumulated" was always showing 0 because the query was failing silently. Fixed by using the correct vstorage path, and parsing the response correctly: