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

Extension observer comparison code is now moved to front side #2233

Merged
merged 1 commit into from
Apr 18, 2019

Conversation

jasonrsadler
Copy link
Contributor

@jasonrsadler jasonrsadler commented Apr 16, 2019

Fixes brave/brave-browser#3974

Submitter Checklist:

  • 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).
  • Verified that these changes build without errors on
    • Windows
    • macOS
    • Linux
  • Verified that these changes pass automated tests (npm test brave_unit_tests && npm test brave_browser_tests && npm run test-security) on
    • Windows
    • macOS
    • Linux
  • Verified that all lint errors/warnings are resolved (npm run lint)
  • Ran git rebase master (if needed).
  • Ran git rebase -i to squash commits (if needed).
  • Tagged reviewers and labelled the pull request as needed.
  • Request a security/privacy review as needed.
  • Add appropriate QA labels (QA/Yes or QA/No) to include the closed issue in milestone

Test Plan:


  1. Open Brave, clean profile and create wallet from panel.
  2. Ensure wallet is created without errors

  1. Open Brave, clean profile and disconnect from internet
  2. Attempt to create wallet and make sure that failure message appears

  1. Open Brave with this profile https://github.com/brave/brave-browser/files/2823589/Brave-Browser-Beta-05925.zip
  2. Click Rewards panel and make sure that panel is at 'First Run' 'Join Now' screen.

Reviewer Checklist:

  • New files have MPL-2.0 license header.
  • Request a security/privacy review as needed.
  • Adequate test coverage exists to prevent regressions
  • Verify test plan is specified in PR before merging to source

@jasonrsadler jasonrsadler added this to the 0.65.x - Nightly milestone Apr 16, 2019
@jasonrsadler jasonrsadler self-assigned this Apr 16, 2019
@jasonrsadler jasonrsadler changed the title Extension observer comparison code is not moved to front side Extension observer comparison code is now moved to front side Apr 16, 2019
case types.ON_WALLET_CORRUPTED:
state = { ...state }
state.walletCorrupted = true
if (result === 12) { // ledger::Result::WALLET_CREATED
Copy link
Contributor

Choose a reason for hiding this comment

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

Should these results be in some kind of enumeration?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The problem I was seeing is that this result comes from an enum in Ledger. Currently we would have to keep track of making sure the Ledger enum and an enum here would stay in sync.

Copy link
Contributor

Choose a reason for hiding this comment

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

we already do this and you have definition in rewards.d.ts -> Rewards.Result

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice! Never saw that

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sadly, per @NejcZdovc there is currently a problem using ts enum in reducer

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The enum declaration needs to be exported as const in order to work properly. Done.

emerick
emerick previously approved these changes Apr 16, 2019
NejcZdovc
NejcZdovc previously approved these changes Apr 18, 2019
Updated enum declaration to const
@jasonrsadler jasonrsadler requested review from emerick and NejcZdovc and removed request for emerick April 18, 2019 15:57
Copy link
Contributor

@emerick emerick left a comment

Choose a reason for hiding this comment

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

LGTM

@jasonrsadler jasonrsadler merged commit 012aa7b into master Apr 18, 2019
@jasonrsadler jasonrsadler deleted the wallet_init_refactor branch April 18, 2019 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Push wallet result to UI side in extension observer: OnWalletInitialized
3 participants