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

Add sync #6882

Merged
merged 64 commits into from
Feb 15, 2017
Merged

Add sync #6882

merged 64 commits into from
Feb 15, 2017

Commits on Jan 27, 2017

  1. Revert "Convert background page to event page"

    This reverts commit 23203e1.
    diracdeltas committed Jan 27, 2017
    Configuration menu
    Copy the full SHA
    3d0fb35 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    abb9eea View commit details
    Browse the repository at this point in the history
  3. set object ids on bookmarks and history

    auditors: @ayumi
    
    test plan:
    1. start brave
    2. bookmark any page
    3. observe that the terminal console says that the bookmark is created with some objectId
    4. un-bookmark the page
    5. observe that the terminal console says that the bookmark is deleted with the same objectId
    diracdeltas committed Jan 27, 2017
    Configuration menu
    Copy the full SHA
    a38865d View commit details
    Browse the repository at this point in the history
  4. Send site settings and bookmarks when sync starts up

    in case they changed while sync was not yet initialized.
    Also add a TODO for where Ayumi's sync resolution IPC will hook in.
    
    Auditors: @ayumi
    diracdeltas committed Jan 27, 2017
    Configuration menu
    Copy the full SHA
    0661451 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    5778210 View commit details
    Browse the repository at this point in the history
  6. make travis download the sync client bundle

    so it doesn't error
    diracdeltas committed Jan 27, 2017
    Configuration menu
    Copy the full SHA
    62e1d31 View commit details
    Browse the repository at this point in the history
  7. fix failing siteUtil unit test

    'electron' could not be required in the site util test, so unittests had been failing.
    diracdeltas committed Jan 27, 2017
    Configuration menu
    Copy the full SHA
    3f426cb View commit details
    Browse the repository at this point in the history
  8. Save sync init data as Immutable.List instead of Uint8Array

    This prevents the window from crashing on first init, which has been
    causing Travis to fail.
    
    Auditors: @ayumi
    diracdeltas committed Jan 27, 2017
    Configuration menu
    Copy the full SHA
    3587172 View commit details
    Browse the repository at this point in the history
  9. change RECEIVE_SYNC_RECORDS to GET_EXISTING_OBJECTS

    5da9ba5 removed RECEIVE_SYNC_RECORDS
    
    Auditors: @ayumi
    diracdeltas committed Jan 27, 2017
    Configuration menu
    Copy the full SHA
    2405b52 View commit details
    Browse the repository at this point in the history
  10. sync site settings, add SYNC_CLEAR HISTORY

    also refactors reusable sync methods from app/sync.js to js/state/syncUtil.js
    
    Auditors: @ayumi
    
    Test Plan:
    1. start Brave
    2. go to bing.com
    3. disable shields
    4. you should see the console log a setting with 'shieldsUp: false', indicating the sync-client sent the record.
    5. enable shields
    6. same as 4 but with 'shieldsUp: true'
    diracdeltas committed Jan 27, 2017
    Configuration menu
    Copy the full SHA
    980b1ea View commit details
    Browse the repository at this point in the history
  11. add pref for sync

    Adds a preference for sync and categories. Defaults to off.
    
    Test Plan:
    1. go to about:preferences#sync and turn sync on
    3. kill brave and start it again
    4. verify in console that sync is running
    5. go to brave.com, verify that no history is synced
    6. go to about:preferences#sync, enable syncing history
    7. go to brave.com, verify that history is synced this time
    8. go to about:preferences#sync, disable sync
    9. go to brave.com, bookmark it. verify that nothing is synced at all.
    diracdeltas committed Jan 27, 2017
    Configuration menu
    Copy the full SHA
    1e12b9b View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    4f16d95 View commit details
    Browse the repository at this point in the history
  13. Add Sync logo

    Auditors: @diracdeltas
    
    Test Plan:
    1. Start Brave, go to Preferences #Sync and check out the sweet pyramid
    ayumi authored and diracdeltas committed Jan 27, 2017
    Configuration menu
    Copy the full SHA
    3284b51 View commit details
    Browse the repository at this point in the history
  14. move setObjectId from syncUtil to siteUtil to avoid dependency problems

    7abab4b caused node to throw 'module not found' errors when siteUtil (which depended on syncUtil) was imported into renderer components, i think. This avoids the problem by not having siteUtil depend on syncUtil.
    
    also auto-added docs from the post-commit hook
    
    Auditors: @ayumi
    
    Test Plan:
    1. npm start
    2. you should not see any 'module not found' errors in the terminal
    diracdeltas committed Jan 27, 2017
    Configuration menu
    Copy the full SHA
    f3b1a57 View commit details
    Browse the repository at this point in the history
  15. Fix SYNC_CLEAR_HISTORY

    ayumi authored and diracdeltas committed Jan 27, 2017
    Configuration menu
    Copy the full SHA
    08c913a View commit details
    Browse the repository at this point in the history
  16. Fix applying Create bookmark folders

    Auditors: @diracdeltas
    ayumi authored and diracdeltas committed Jan 27, 2017
    Configuration menu
    Copy the full SHA
    6d31ee9 View commit details
    Browse the repository at this point in the history
  17. add sync QR code and setup options

    This adds most of the UX for Brave sync setup in the case where this device is the first device in the sync profile.
    
    Auditors: @ayumi
    
    Test Plan:
    1. npm run clean-session-store
    2. npm start
    3. go to about:preferences#sync
    4. click the orange button to set up sync for the first time
    5. name the device, then click the create button
    6. shut down brave, run npm start again
    7. you should see the device name from (5) in the terminal console
    8. go to about:preferences#sync, click 'add new device' button
    9. you should see a QR code
    diracdeltas committed Jan 27, 2017
    Configuration menu
    Copy the full SHA
    71f090a View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    502ea23 View commit details
    Browse the repository at this point in the history
  19. Fix syncing pinned sites

    Auditors: @diracdeltas
    ayumi authored and diracdeltas committed Jan 27, 2017
    Configuration menu
    Copy the full SHA
    610ecbd View commit details
    Browse the repository at this point in the history
  20. Sync siteSettings with browser data

    Auditors: @diracdeltas
    
    Test Plan:
    
    Prep:
    
    0. Update sync lib to `brave/sync #fix/resolve-delete-nonexistant-props`.
    1. Prepare 2 instances (pyramids) of Brave with Sync enabled.
      - Enable Sync and close Brave.
      - Copy `{userData}/brave-development` to `{userData}/brave-development-2`.
      - Edit `brave-development-2/session-store-1` `deviceId` to `1`.
      - To `browser-laptop` `package.json` add `"start2": "node ./tools/start.js --user-data-dir=brave-development-2 --debug=5859 --enable-logging --v=0 --enable-extension-activity-logging --enable-sandbox-logging --enable-dcheck",`
    2. In `appConfig.js` `sync.fetchInterval` reduce to 5 seconds.
    
    Play:
    
    3. Open both pyramid 1 and pyramid 2.
    4. In pyramid 1 visit a webpage and open up the bravery panel.
    5. In pyramid 2 visit the same page and open up the bravery panel.
    6. In pyramid 2 toggle each available siteSetting. Observe it appears in pyramid 1 after 1–5s.
    7. Try toggling multiple settings at once, and toggling different settings simulatenously on both pyramids.
    8. In both go to Preferences #Shields. Clear siteSettings with the Clear links and the red X's. Observe they sync over.
    ayumi authored and diracdeltas committed Jan 27, 2017
    Configuration menu
    Copy the full SHA
    985e9c3 View commit details
    Browse the repository at this point in the history
  21. allow browser-laptop to join an existing sync profile

    by entering the 16 code words
    diracdeltas committed Jan 27, 2017
    Configuration menu
    Copy the full SHA
    934acb5 View commit details
    Browse the repository at this point in the history
  22. On Sync init only send siteSettings without objectId

    Auditors: @diracdeltas
    
    Test Plan:
    1. Have Sync disabled.
    2. Browse a site and toggle a Bravery Panel setting.
    3. Enable Sync and restart your pyramid. Note that siteSettings are sent.
    4. Restart your pyramid again. Note this time siteSettings are *not* sent.
    ayumi authored and diracdeltas committed Jan 27, 2017
    Configuration menu
    Copy the full SHA
    8bfc8fa View commit details
    Browse the repository at this point in the history
  23. Sync: Apply records asynchronously

    Fix brave/sync#44
    
    Auditors: @diracdeltas
    
    Test Plan:
    1. Start Pyramid 1 which has a bunch of syncable data. Sync should enabled.
    2. Setup Pyramid 2 (add `"start2": "node ./tools/start.js --user-data-dir=brave-development-2 --debug=5859 --enable-logging --v=0 --enable-extension-activity-logging --enable-sandbox-logging --enable-dcheck",` to package.json) and specify the Pyramid 1 Sync credentials.
    3. When Pyramid 2 restarts and begins syncing data, Brave should be somewhat usable (not completely frozen for 60s).
    ayumi authored and diracdeltas committed Jan 27, 2017
    Configuration menu
    Copy the full SHA
    65a8764 View commit details
    Browse the repository at this point in the history

Commits on Jan 30, 2017

  1. Fix Sync objectId generation when disabled

    Previously we were generating objectIds even when Sync was disabled,
    thus bookmarks created prior to Sync were not synced during the sync first
    run.
    
    Auditors: @diracdeltas
    ayumi committed Jan 30, 2017
    4 Configuration menu
    Copy the full SHA
    41a997e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    81c66d0 View commit details
    Browse the repository at this point in the history
  3. Sync initial bookmarks in order

    Fix brave/sync#48
    
    Test plan:
    1. Start Pyramid 0. It should have bookmarks and bookmark folders.
    2. Enable Sync on Pyramid 0, and restart to complete setup.
    3. Start Pyramid 1. Add it to Pyramid 0's Sync profile and restart.
    4. Bookmarks should sync in the same order.
    ayumi committed Jan 30, 2017
    Configuration menu
    Copy the full SHA
    bf9f40d View commit details
    Browse the repository at this point in the history
  4. Merge pull request #6832 from brave/feature/syncing-bookmarks-order

    Sync bookmarks in order, without conflict
    diracdeltas authored Jan 30, 2017
    Configuration menu
    Copy the full SHA
    85c8126 View commit details
    Browse the repository at this point in the history
  5. Mock sync to be enabled in siteUtilTest

    The test was failing due to 41a997e
    
    Auditors: @ayumi
    
    Test Plan: npm run unittest
    diracdeltas committed Jan 30, 2017
    Configuration menu
    Copy the full SHA
    52b1dc8 View commit details
    Browse the repository at this point in the history

Commits on Jan 31, 2017

  1. Configuration menu
    Copy the full SHA
    7c6cc79 View commit details
    Browse the repository at this point in the history
  2. fix failing unittests

    diracdeltas committed Jan 31, 2017
    Configuration menu
    Copy the full SHA
    6ce74fd View commit details
    Browse the repository at this point in the history
  3. Change syncUtil to use site Map instead of List

    Fixes some issues caused by the merge.
    TODO: re-enable bookmark syncing in order
    
    Auditors: @ayumi
    
    Test Plan:
    1. create pyramid with some bookmarks and bookmark folders
    2. sync pyramid 0
    3. start pyramid 1, sync it
    4. watch bookmarks flow from pyramid 0 to pyramid 1
    5. add some bookmarks in pyramid 1; they should flow back
    diracdeltas committed Jan 31, 2017
    Configuration menu
    Copy the full SHA
    507564c View commit details
    Browse the repository at this point in the history

Commits on Feb 1, 2017

  1. Sync initial bookmarks in order

    Re-introduce SyncRecord.Bookmark.index after Sites Map refactor.
    
    Fix brave/sync#45
    
    Auditors: @diracdeltas
    
    Test plan:
    1. Start Pyramid 0. It should have bookmarks and bookmark folders.
    2. Enable Sync on Pyramid 0, and restart to complete setup.
    3. Start Pyramid 1. Add it to Pyramid 0's Sync profile and restart.
    4. Bookmarks should sync onto Pyramid 1 in the same order as Pyd 0.
    ayumi committed Feb 1, 2017
    Configuration menu
    Copy the full SHA
    620cffc View commit details
    Browse the repository at this point in the history
  2. Merge pull request #6964 from brave/feature/syncing-bookmarks-order-2

    Sync initial bookmarks in order
    diracdeltas authored Feb 1, 2017
    Configuration menu
    Copy the full SHA
    a0045fe View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    69e449f View commit details
    Browse the repository at this point in the history

Commits on Feb 3, 2017

  1. Configuration menu
    Copy the full SHA
    4a6c304 View commit details
    Browse the repository at this point in the history

Commits on Feb 4, 2017

  1. Configuration menu
    Copy the full SHA
    1380d48 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8eb2d4a View commit details
    Browse the repository at this point in the history

Commits on Feb 7, 2017

  1. Configuration menu
    Copy the full SHA
    bad3f11 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #7086 from brave/feature/restartless-sync

    implement restartless sync
    diracdeltas authored Feb 7, 2017
    Configuration menu
    Copy the full SHA
    4074874 View commit details
    Browse the repository at this point in the history
  3. Test bookmark Sync

    ayumi committed Feb 7, 2017
    Configuration menu
    Copy the full SHA
    f980210 View commit details
    Browse the repository at this point in the history

Commits on Feb 8, 2017

  1. Merge pull request #7118 from brave/feature/syncing-test-bookmarks

    Test bookmark Sync
    ayumi authored Feb 8, 2017
    Configuration menu
    Copy the full SHA
    6b555ce View commit details
    Browse the repository at this point in the history
  2. Test syncing history and site settings

    and clearing them should prevent syncing.
    ayumi committed Feb 8, 2017
    Configuration menu
    Copy the full SHA
    fe4b7ee View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    eea6318 View commit details
    Browse the repository at this point in the history

Commits on Feb 9, 2017

  1. Merge pull request #7136 from brave/feature/syncing-test-history-site…

    …-settings
    
    Test syncing bookmark folders, history and site settings
    ayumi authored Feb 9, 2017
    Configuration menu
    Copy the full SHA
    3d20e69 View commit details
    Browse the repository at this point in the history
  2. Add the sweet sync logo to the extension

    Test Plan:
    1. Go to about:extensions.
    2. there should be a sweet logo
    
    Auditors: @diracdeltas
    ayumi committed Feb 9, 2017
    2 Configuration menu
    Copy the full SHA
    ed176a6 View commit details
    Browse the repository at this point in the history
  3. Fix restartless sync on first device setup

    Auditors: @ayumi
    
    Test Plan:
    1. npm run clean-session-store
    2. open brave and enable sync
    3. sync should start without requiring a restart
    diracdeltas committed Feb 9, 2017
    Configuration menu
    Copy the full SHA
    4dc48df View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    f392fad View commit details
    Browse the repository at this point in the history

Commits on Feb 10, 2017

  1. Configuration menu
    Copy the full SHA
    375ba5d View commit details
    Browse the repository at this point in the history
  2. Syncing styling

    Also show device name
    
    Auditors: @diracdeltas
    ayumi committed Feb 10, 2017
    Configuration menu
    Copy the full SHA
    7dad719 View commit details
    Browse the repository at this point in the history
  3. Merge pull request #7145 from brave/feature/syncing-tests-3

    Test syncing can be turned off; private history does not sync
    ayumi authored Feb 10, 2017
    Configuration menu
    Copy the full SHA
    2d43d47 View commit details
    Browse the repository at this point in the history
  4. Merge pull request #7152 from brave/feature/syncing-styling

    Syncing styling
    diracdeltas authored Feb 10, 2017
    Configuration menu
    Copy the full SHA
    04af333 View commit details
    Browse the repository at this point in the history

Commits on Feb 11, 2017

  1. disable sync restore button until code words are entered

    Auditors: @ayumi
    
    Test Plan:
    1. go to about:preferences#sync
    2. click 'i have an existing sync code'
    3. the setup button should be disabled
    4. enter some text in the textbox
    5. the setup button should be enabled
    diracdeltas committed Feb 11, 2017
    Configuration menu
    Copy the full SHA
    7f1e79f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4cd74b0 View commit details
    Browse the repository at this point in the history
  3. fix issues related to merge and sync default naming

    Auditors: @ayumi
    
    Test Plan:
    1. enable sync for the first time
    2. don't change the default device name
    3. once sync is enabled, it should show 'Mac Laptop' as the device name or whatever your OS is
    diracdeltas committed Feb 11, 2017
    Configuration menu
    Copy the full SHA
    a66f921 View commit details
    Browse the repository at this point in the history

Commits on Feb 13, 2017

  1. Adjust width of sync toggle pref / device name

    Test Plan:
    1. Open Preferences > Sync.
    2. With Sync enabled, the area with the toggle switch and device name should look ok.
    ayumi committed Feb 13, 2017
    Configuration menu
    Copy the full SHA
    a80b05b View commit details
    Browse the repository at this point in the history

Commits on Feb 14, 2017

  1. Configuration menu
    Copy the full SHA
    7c59a85 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8c39e18 View commit details
    Browse the repository at this point in the history
  3. Sync bookmarks in order during initial sync

    Depends on brave/sync #fix/timestamp-ms to return S3 records in upload order.
    
    Test Plan:
    1. `npm run test -- --grep='"^Syncing bookmarks from an"'`
    ayumi committed Feb 14, 2017
    Configuration menu
    Copy the full SHA
    1a69b53 View commit details
    Browse the repository at this point in the history
  4. Merge pull request #7236 from brave/feature/syncing-bookmarks-existing

    Sync bookmarks in order during initial sync
    diracdeltas authored Feb 14, 2017
    Configuration menu
    Copy the full SHA
    0239612 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    4984218 View commit details
    Browse the repository at this point in the history
  6. Remove Sync test pauses

    ayumi committed Feb 14, 2017
    Configuration menu
    Copy the full SHA
    2618188 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    d132bdf View commit details
    Browse the repository at this point in the history

Commits on Feb 15, 2017

  1. Prepare Sync for packaging

    - Add download sync client to package.json postinstall
    - Fix sync endpoints to be prod for packaged apps
    
    Auditors: @diracdeltas @bsclifton
    
    Test Plan:
    - Remove `node_modules`.
    - `npm install`.
    - `CHANNEL=dev npm run build-package` / `CHANNEL=dev npm run build-installer`.
    - Open the built app.
    - Preferences > Sync should be present.
    - Enable Sync.
    - Sync should connect to `https://sync.brave.com` and `https://brave-sync.s3.dualstack.us-west-2.amazonaws.com`. (You could check this with Little Snitch for MacOS)
    ayumi committed Feb 15, 2017
    Configuration menu
    Copy the full SHA
    7c4aeb8 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #7247 from brave/feature/syncing-auto-dl-lib

    Prepare Sync for packaging
    diracdeltas authored Feb 15, 2017
    Configuration menu
    Copy the full SHA
    7809a0a View commit details
    Browse the repository at this point in the history