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

Handle invalid grant notification ID #812

Merged
merged 1 commit into from
Nov 6, 2018

Conversation

emerick
Copy link
Contributor

@emerick emerick commented Nov 6, 2018

Fixes brave/brave-browser#2004

We recently changed the format of the grant notification ID from an
integer to a string. We've encountered a scenario where an old install
may erroneously set the ID to 0 (which was never a valid value). Once
you're in this state, it's impossible to dismiss the notification. To
fix this, we look for this case on startup and modify the notification
to have the correct ID.

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) on
    • Windows
    • macOS
    • Linux
  • 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. Delete your existing profile
  2. Launch Brave
  3. Opt-in to Rewards
  4. Close Brave without dismissing the grant notification
  5. In your profile directory, open the Preferences file and in the brave.rewards.notifications section set id to 0
  6. Save the Preferences file
  7. Launch Brave
  8. Try to dismiss grant notification by clicking its OK button

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

We recently changed the format of the grant notification ID from an
integer to a string. We've encountered a scenario where an old install
may erroneously set the ID to 0 (which was never a valid value). Once
you're in this state, it's impossible to dismiss the notification. To
fix this, we look for this case on startup and modify the notification
to have the correct ID.
@bbondy
Copy link
Member

bbondy commented Nov 6, 2018

Uplift requested for if we respin 0.56.x Release channel, or for the next hotfix if not.
This makes it so a notification prompt doesn't get stuck.

@kjozwiak
Copy link
Member

kjozwiak commented Nov 6, 2018

Approved for 0.56.x-Release uplift after discussing with @rebron and @sri 👍

@NejcZdovc NejcZdovc merged commit e5127c9 into master Nov 6, 2018
@NejcZdovc NejcZdovc deleted the fix-invalid-notification-id branch November 6, 2018 05:03
NejcZdovc added a commit that referenced this pull request Nov 6, 2018
NejcZdovc added a commit that referenced this pull request Nov 6, 2018
NejcZdovc added a commit that referenced this pull request Nov 6, 2018
@NejcZdovc
Copy link
Contributor

master (0.59.x) e5127c9
0.58.x 379afa2
0.57.x f0580a5
0.56.x 5a62038

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.

Can't dismiss grant notification
5 participants