-
Notifications
You must be signed in to change notification settings - Fork 30
feat(frontend): improves error handling for btc wallet sync #5601
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(frontend): improves error handling for btc wallet sync #5601
Conversation
I'm a bit concerned how would it look like in this case - let's imagine user has the BTC page open, and suddenly all the content is gone. Previously, the error implied that something went wrong (even though in a very unfriendly manner). But now, it will be gone without any feedback, and in the best case the data will reappear again in 30 seconds. IMO, it would be acceptable if we re-try to fetch the data instantly, without waiting for the next worker tick. |
…roves-btc-wallet-sync-error-handling # Conflicts: # src/frontend/src/lib/constants/app.constants.ts
Randomly landing here and unsolicited feedback: besides sharing @DenysKarmazynDFINITY's concern, I'm also worried about the implementation. If any logic related to handling potential errors from queries or updates needs to be implemented, it should be placed as close as possible to where those errors can occur otherwise, there's a risk of introducing issues as the all chain of events is not asserted. Additionally, implementing an error count in the UI for a message emitted from a worker feels a bit hacky but, that's more a personal opinion. |
I updated the code so that the concern raised by @DenysKarmazynDFINITY is no longer valid. The current approach is to only reset the @peterpeterparker do you think it would be better to move the "counter logic" from the |
I mean the logic is not in the worker. In the current proposed implementation, the counter is on the UI side, in the listener for messages. I haven’t looked at the code, but IMO, the logic should be placed as close as possible to the source. If the error is triggered by the scheduler, then indeed yes, it should go there. Maybe it could even become a generic feature of the scheduler, notably if other features potentially require skipping a certain counts of errors, but of course, only if this pattern is actually what’s needed, and only if it’s acceptable from a security perspective. |
As discussed here |
…roves-btc-wallet-sync-error-handling # Conflicts: # src/frontend/src/btc/schedulers/btc-wallet.scheduler.ts
…roves-btc-wallet-sync-error-handling # Conflicts: # src/frontend/src/tests/btc/workers/btc-wallet.worker.spec.ts
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.
Small comment, otherwise LGTM!
Motivation
Currently every time the request to load the BTC wallet data fails, we display an error toast. In some cases this leads to multiple error toasts being displayed if the application has been idle. To improve the user experience we want to only show the error toast if the request fails 3 times in a row. In this way, the user will not be interrupted by unnecessary error messages when everything else works as expected.
Changes