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

Browser no longer crashes when upgrading from a v3 to a v5+ database #2122

Merged
merged 1 commit into from
Apr 10, 2019

Conversation

jasonrsadler
Copy link
Contributor

@jasonrsadler jasonrsadler commented Mar 30, 2019

Fixes brave/brave-browser#3907

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. Start Brave with clean profile and enable rewards.
  2. Close Browser.
  3. Copy a v3 publisher_info_db (use attached from issue or attached v2 below) to profile/default
  4. Start Brave
  5. Open Panel or brave://rewards and ensure browser does not crash

Alternatively:

  1. Start Brave with clean profile and enable rewards.
  2. Download and remove the 'zip' extension from the db file included at the bottom of this comment
  3. Replace publisher_info_db with the one downloaded below.
  4. Restart Brave and go to brave://rewards or open the panel and ensure database migration completes without crashing browser.

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

publisher_info_db.remove_zip_ext.zip

@NejcZdovc
Copy link
Contributor

Nice find. I think that we need to think more future proof, so we need to move all create/index functions inside upgrade process functions. This way for example if we delete activity_info functions older versions still have upgrade path.

Copy link
Contributor

@NejcZdovc NejcZdovc left a comment

Choose a reason for hiding this comment

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

let's add create scripts into migration functions, this way we are future proof

@jasonrsadler jasonrsadler force-pushed the db-migrate-fix branch 3 times, most recently from 0104000 to def6fa1 Compare April 5, 2019 01:48
@jasonrsadler jasonrsadler dismissed NejcZdovc’s stale review April 5, 2019 01:49

Create scripts have been moved into migration functions. Also some unrelated lint fixes.

@jasonrsadler jasonrsadler requested a review from NejcZdovc April 5, 2019 01:50
@jasonrsadler jasonrsadler force-pushed the db-migrate-fix branch 2 times, most recently from 6428dfe to d9cef4b Compare April 7, 2019 03:02
simplified conditional

Updated migrations to use own version sql

lint fixes

Remove original fix.

Updated db var naming

lint
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.

Brave crashes when trying to migrate from v3 to v5+ publisher_info_db version
2 participants