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

feat(web-components): surface wallet connection rpc errors #66

Merged
merged 2 commits into from
Dec 14, 2023

Conversation

samsiegart
Copy link
Contributor

refs Agoric/agoric-sdk#8505

We improved error handling to the chainStorageWatcher in #65, but the makeAgoricWalletConnection component uses the RPC endpoint rather than the API endpoint, and doesn't surface errors conveniently when queries fail. This adds an onRpcError parameter so that clients can respond accordingly when the RPC node is failing.

Also, made it only call await Tendermint34Client.connect(rpc) once instead of every time it queries the bank. This removes an extra round trip to reduce load on the RPC node. Also added up to 2 retries around queryBank because the tendermint client doesn't do any retries on its own.

/**
* @param {any} chainStorageWatcher
* @param {string} rpc
* @param {((error: unknown) => void)=} onRpcError
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not worth another push, but in agoric-sdk we use jsdoc syntax,

Suggested change
* @param {((error: unknown) => void)=} onRpcError
* @param {((error: unknown) => void)} [onRpcError]

@samsiegart samsiegart enabled auto-merge (rebase) December 14, 2023 20:53
@samsiegart samsiegart merged commit 6a4c62e into main Dec 14, 2023
1 check passed
@samsiegart samsiegart deleted the wallet-connection-errors branch December 14, 2023 20:54
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