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

make "ERROR_FETCHING_BALANCE(1)" under reward banner more readable #12224

Closed
kjozwiak opened this issue Oct 20, 2020 · 2 comments · Fixed by brave/brave-core#6954
Closed

make "ERROR_FETCHING_BALANCE(1)" under reward banner more readable #12224

kjozwiak opened this issue Oct 20, 2020 · 2 comments · Fixed by brave/brave-core#6954

Comments

@kjozwiak
Copy link
Member

kjozwiak commented Oct 20, 2020

Description

Sometimes you'll get the following error message in the rewards banner rather than the expected UI. We should probably make it a more user friendly that actually explains what happened so users understand. Maybe a retry button would help as well rather than needing to close/re-open the banner.

Oops - an error has occurred.
    ERROR_FETCHING_BALANCE(1)

Which produced the following in the terminal:

[68797:775:1020/162939.076978:VERBOSE6:logging_util.cc(136)]
[ RESPONSE - OnRequest ]
> Url: https://grant.rewards.bravesoftware.com/v3/wallet/uphold/723d5a31-3c4a-4324-9b53-e72d41afe082
> Result: Failure
> HTTP Code: 429
> Body: limit exceeded

Steps to Reproduce

  1. launch brave (used staging in this case)
  2. enable rewards and restore a wallet with BAT
  3. visit https://www.reddit.com/user/jsadler-brave
  4. click on the banner several times quickly and tip/Tweet
  5. go back to the https://www.reddit.com/user/jsadler-brave tab (should see multiple banners opened)

Eventually you'll see the ERROR_FETCHING_BALANCE(1) error.

Actual result:

Screen Shot 2020-10-20 at 1 41 52 PM

Expected result:

Screen Shot 2020-10-20 at 2 09 42 PM

Reproduces how often:

I can't reproduce 100% but I've seen this happen ~2-3 times.

Brave version (brave://version info)

Brave | 1.17.42 Chromium: 86.0.4240.99 (Official Build) nightly (x86_64)
-- | --
Revision | 002668237e13d38aabd6d11c2d216dd22b736ff2-refs/branch-heads/4240@{#1229}
OS | macOS Version 10.15.7 (Build 19H2)

Version/Channel Information:

  • Can you reproduce this issue with the current release? N/A
  • Can you reproduce this issue with the beta channel? Yes
  • Can you reproduce this issue with the nightly channel? Yes

Other Additional Information:

  • Does the issue resolve itself when disabling Brave Shields? N/A
  • Does the issue resolve itself when disabling Brave Rewards? N/A
  • Is the issue reproducible on the latest version of Chrome? N/A

Miscellaneous Information:

CCing @NejcZdovc @rebron @LaurenWags

@zenparsing
Copy link

@codybanxs Here are the error states that the tip dialog might find itself in:

  • ERROR_FETCHING_BALANCE:
    • Trigger: the rewards service was unable to retrieve a user wallet balance either locally or (more commonly) from a wallet provider like Uphold.
    • Possible user actions: close dialog and retry. As mentioned above, we could also add a "retry" button for this state, which would send another request to the rewards service to query for the wallet balance.
  • INVALID_DIALOG_ARGS:
    • Trigger: the dialog window was opened with a set of arguments that are incomplete or invalid. Most likely a programming error.
    • Possible user action: close dialog and retry.

There are a couple of other error states that would indicate a programming error. Similar to INVALID_DIALOG_ARGS, the only thing to user could do is to close and retry.

@GeetaSarvadnya
Copy link

GeetaSarvadnya commented Nov 24, 2020

Verification passed on


Brave | 1.18.59 Chromium: 87.0.4280.67 (Official Build) dev (64-bit)
-- | --
Revision | 0e5d92df40086cf0050c00f87b11da1b14580930-refs/branch-heads/4280@{#1441}
OS | Windows 10 OS Version 2004 (Build 19041.630)


  • Verified the STR from the description and ensured that there is no error message display in the tipping banner when multiple tips are sent quickly to the same pubs.
  • Verified user-friendly error message Server connection error displayed in the banner when wifi/internet is down
    image
Server connection error
Please close and reopen the tipping banner to try again.
ERR_FETCH_BALANCE : 1
  • Verified the console logs when wifi/internet is down
[ REQUEST ]
> URL: https://grant.rewards.bravesoftware.com/v3/wallet/uphold/b632b4b1-51ca-4262-a216-daab4acd35b9
> Method: UrlMethod::GET
[16716:10136:1124/151137.642:VERBOSE6:logging_util.cc(136)]
[ RESPONSE - OnRequest ]
> Url: https://grant.rewards.bravesoftware.com/v3/wallet/uphold/b632b4b1-51ca-4262-a216-daab4acd35b9
> Result: Error (net::ERR_INTERNET_DISCONNECTED)
> HTTP Code: -1
> Body:
[16716:10136:1124/151137.644:INFO:wallet_balance.cc(68)] Couldn't fetch wallet balance
[11484:13760:1124/151141.098:WARNING:dns_config_service_win.cc(692)] Failed to read DnsConfig.
[16716:10136:1124/151150.240:VERBOSE2:permission_rule_util.cc(24)] Network connection is unavailable

  • Verified error message is removed from banner once the panel is closed and opened after reconnecting wifi/internet
  • Verified Tips can be sent again once wifi/internet is reconnected
  • Verified the test plan from Add more user-friendly messaging for tip dialog errors brave-core#6954
  • Verified following error message is displayed after executing window[Symbol.for('setTipDialogErrorForTesting')]('ERR_INVALID_DIALOG_ARGS') in the console in tipping banner
    image
  • Verified the following error message after executing window[Symbol.for('setTipDialogErrorForTesting')]('ERR_FETCH_BALANCE', 1) in the console in tipping banner
    image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment