Skip to content
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

Merged
merged 2 commits into from
Jun 21, 2023
Merged

fix: read beansOwing correctly #95

merged 2 commits into from
Jun 21, 2023

Conversation

samsiegart
Copy link
Contributor

"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:
image

@samsiegart samsiegart requested a review from turadg June 21, 2023 01:30
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jun 21, 2023

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 8fd9484
Status: ✅  Deploy successful!
Preview URL: https://6f4ac418.wallet-app.pages.dev
Branch Preview URL: https://fix-beansowing.wallet-app.pages.dev

View logs

Copy link
Member

@turadg turadg left a 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);
Copy link
Member

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?

Copy link
Contributor Author

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.

@samsiegart
Copy link
Contributor Author

Needs a regression test. I'll accept an issue to develop one.

Created #96. The changes to batchQuery.ts will be tested when I move the code to ui-kit

@@ -321,15 +336,19 @@ export const makeWalletBridgeFromFollowers = (
value.liveOffers ?? [],
);
},
err => {
console.error('error watching pending offers', err);
errorHandler(new Error(err));
Copy link
Member

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?

Copy link
Contributor Author

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

@samsiegart samsiegart merged commit 112581b into main Jun 21, 2023
@samsiegart samsiegart deleted the fix-beansowing branch June 21, 2023 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants