Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Improve UX of unavailable ledger balance #3805

Merged
merged 1 commit into from
Sep 8, 2016

Conversation

ayumi
Copy link
Contributor

@ayumi ayumi commented Sep 8, 2016

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Ran git rebase -i to squash commits (if needed).

Fix #3778 #3785

Adds ledgerInfo.error for debugging and UI.

Auditors: @mrose17 @bbondy

Test Plan:

Offline case:

  1. Disable internet
  2. Re/open Brave
  3. Open Preferences -> Payments
  4. Observe that account balance shows "error, can't retrieve data" and not 0

Online case:

  1. In Brave, open Preferences -> Payments and leave it open
  2. Close and reopen Brave
  3. Observe Payments balance shows "loading" or the correct amount

Offline case / Expected result:
screen shot 2016-09-07 at 18 54 33

@ayumi ayumi force-pushed the fix/gentle-offline-ledger-balance branch from 8278f41 to 3e1f025 Compare September 8, 2016 01:57

// if the last updateLedgerInfo happened concurrently with an error, this
// saves it for UI or debugging
error: null // {
Copy link
Member

Choose a reason for hiding this comment

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

as @diracdeltas is fond of saying: don't forget to update docs/state.md

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thx, that is a good idea

@mrose17
Copy link
Member

mrose17 commented Sep 8, 2016

@ayumi - have you been able to reproduce either of the issues? i never have.

my theory has been that (! this.props.ledgerData) === true, but i until i can reproduce it, i can't really say.

on a mac, sometimes i see the payments panel show the 'Welcome to Brave Payments' page and then flip into the actual page a few 100ms later.

on linux, i suspect that something similar may be going on.

what's your thinking? thanks!

Fix #3778
Fix #3785 or at least a gentle fallback
@ayumi ayumi force-pushed the fix/gentle-offline-ledger-balance branch from 3e1f025 to fffa903 Compare September 8, 2016 04:42
@ayumi
Copy link
Contributor Author

ayumi commented Sep 8, 2016

@mrose17 I can repro #3785 and #3778 at 5b10525 on Mac OS X.

I've repro'd by disabling wifi and by specifically blocking Brave using Little Snitch.

This PR fixes it for me.

@mrose17
Copy link
Member

mrose17 commented Sep 8, 2016

@ayumi - excellent!

please merge the PR into master!

@ayumi ayumi merged commit b59e8cf into master Sep 8, 2016
@ayumi ayumi deleted the fix/gentle-offline-ledger-balance branch September 8, 2016 05:03
@luixxiul luixxiul added this to the 0.12.1dev milestone Sep 12, 2016
@luixxiul luixxiul added design A design change, especially one which needs input from the design team. feature/rewards labels Sep 28, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
design A design change, especially one which needs input from the design team. feature/rewards QA/checked-Linux QA/checked-Win32 QA/checked-Win64
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants