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

handle empty objects in sync DELETEs, refactor DELETE code #9349

Merged
merged 1 commit into from
Jun 12, 2017

Conversation

diracdeltas
Copy link
Member

@diracdeltas diracdeltas commented Jun 9, 2017

fix #9308
gets rid of syncActions.removeSite by DELETEing sites in the appStoreChange listener instead

test plan:

  1. enable sync in pyramid 0.
  2. bookmark some sites and folders and then delete some.
  3. sync pyramid 1 to pyramid 0. it should show the same bookmarks.
  4. delete a bookmark and bookmark folder in pyramid 1. they should be deleted in pyramid 0.
  5. syncing tests should pass.

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).
  • Ran git rebase -i to squash commits (if needed).
  • Tagged reviewers and labelled the pull request as needed.

Test Plan:

Reviewer Checklist:

Tests

  • Adequate test coverage exists to prevent regressions
  • Tests should be independent and work correctly when run individually or as a suite ref
  • New files have MPL2 license header

@ayumi
Copy link
Contributor

ayumi commented Jun 12, 2017

i'm having mild issues testing this right now because i can't delete bookmarks (right click menu doesn't work on toolbar or bookmarks manager)

@diracdeltas
Copy link
Member Author

diracdeltas commented Jun 12, 2017

@ayumi same; i worked around it by going to the site and clicking on the bookmark star to edit it. doesn't work for deleting bookmark folders though.

@diracdeltas
Copy link
Member Author

@ayumi fixed by rebase

Copy link
Contributor

@ayumi ayumi left a comment

Choose a reason for hiding this comment

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

I get an error when sync is enabled and i try to delete a bookmark toolbar bookmark or folder:

sync 1497298899503: sending record: {"action":0,"bookmark":{"hideInToolbar":false,"isFolder":false,"site":{"creationTime":0,"customTitle":"","favicon":"","lastAccessedTime":0,"location":"https://archive.org/","title":"Internet Archive: Digital Library of Free Books, Movies, Music & Wayback Machine"}},"deviceId":{"0":0},"objectId":{"0":88,"1":27,"2":9,"3":5,"4":193,"5":163,"6":63,"7":17,"8":32,"9":20,"10":19,"11":60,"12":194,"13":251,"14":248,"15":199}}
An uncaught exception occurred in the main process Uncaught Exception:
AssertionError: state must be an Immutable.Map
    at validateState (/repos/github.com/brave/browser-laptop/app/common/state/windowState.js:18:10)
    at Object.getActiveWindow (/repos/github.com/brave/browser-laptop/app/common/state/windowState.js:75:13)
    at Object.getActiveWindowId (/repos/github.com/brave/browser-laptop/app/common/state/windowState.js:80:21)
    at Object.getActiveTab (/repos/github.com/brave/browser-laptop/app/common/state/tabState.js:543:48)
    at updateActiveTabBookmarked (/repos/github.com/brave/browser-laptop/app/browser/reducers/sitesReducer.js:32:24)
    at sitesReducer (/repos/github.com/brave/browser-laptop/app/browser/reducers/sitesReducer.js:85:15)

STR:

  1. Fresh profile; enable sync.
  2. Add folder to bookmark toolbar
  3. Try to delete the folder from the toolbar

* @param {Object} action
* @returns {boolean}
*/
const validateAction = (action) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

is this no longer needed?

Copy link
Member Author

Choose a reason for hiding this comment

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

correct

@diracdeltas
Copy link
Member Author

@ayumi that error should be fixed now

Copy link
Contributor

@ayumi ayumi left a comment

Choose a reason for hiding this comment

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

@diracdeltas
Copy link
Member Author

https://travis-ci.org/brave/browser-laptop/jobs/242177590 shows 1 test failure but it passes locally so seems unrelated

@diracdeltas diracdeltas merged commit ba4d7d4 into master Jun 12, 2017
@bsclifton bsclifton deleted the fix/9308 branch June 12, 2017 22:10
@bsclifton
Copy link
Member

@diracdeltas don't forget to cherry-pick into 0.18.x now that master is pointing at 0.19.x 😄

@diracdeltas
Copy link
Member Author

@bsclifton cool, i will do that once the fixes for this PR are approved (#9407)

diracdeltas added a commit that referenced this pull request Jun 13, 2017
handle empty objects in sync DELETEs, refactor DELETE code
@diracdeltas
Copy link
Member Author

this is causing weird behavior with moving sites. may have to revert.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

handle sync DELETE history/bookmark records with empty objects
4 participants