-
Notifications
You must be signed in to change notification settings - Fork 974
Conversation
This reverts commit 23203e1.
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
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
so it doesn't error
'electron' could not be required in the site util test, so unittests had been failing.
This prevents the window from crashing on first init, which has been causing Travis to fail. Auditors: @ayumi
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'
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.
Auditors: @diracdeltas Test Plan: 1. Start Brave, go to Preferences #Sync and check out the sweet pyramid
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
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
Auditors: @diracdeltas
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.
by entering the 16 code words
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.
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).
The test plan previously worked against 0.13.1 but seems buggy with master (bookmark favicon is synced but not the actual bookmark location). Site settings sync seems to be working. |
Also show device name Auditors: @diracdeltas
Test syncing can be turned off; private history does not sync
Syncing styling
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
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
Test Plan: 1. Open Preferences > Sync. 2. With Sync enabled, the area with the toggle switch and device name should look ok.
assert.deepEqual(processedSites.toJS(), expectedSites) | ||
}) | ||
it('sets an objectId when syncCallback is provided', function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This appears to be describing and update/edit case if I am not mistaken.
What I did not notice is a deletion test case.
test/components/syncTest.js
Outdated
.waitForUrl(this.page1Url) | ||
yield bookmarkUrl(this.page2Url, this.page2Title) | ||
yield Brave.app.client | ||
.pause(1000) // XXX: Helps to correctly order Create and Update |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than using explicit pauses, is there no promise (or set of nested promises) we can create?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ayumi put some effort into this but it seemed like not easily
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in general i agree on removing explicit pauses; if i understand correctly, it is tricky here because this is waiting on the server to receive the records and process them, which is not something that can be detected client-side (ex: using a waitUntil for some appState change). since the server can't push notifications to the client, we would have to have the client poll the server periodically to detect when a sync operation has finished.
}) | ||
}) | ||
|
||
describe('Syncing history', function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if the separate machines have overlapping timestamps for history? Do we have tiebreaker logic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure what you mean by a 'tie'. if the same history entry (same location) has two sync records with the same timestamp, the one which is received later by the sync server wins.
}) | ||
}) | ||
|
||
describe('Syncing site settings', function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens for conflicting site preferences? How do we tiebreak?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i believe the record which is received later always wins. https://github.com/brave/sync/blob/staging/client/recordUtil.js#L103
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"'`
Sync bookmarks in order during initial sync
- 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)
Prepare Sync for packaging
Discussed with @bsclifton and @bbondy in slack and decided this is good to merge for MVP sync! @alexwykoff we will follow up with polish right away. |
@diracdeltas @ayumi Please update the test plan in the first post, if it is outdated. Also please do not hesitate to add anything which should be tested during QA tests, including edge cases. Thanks in advance! |
@luixxiul thanks, I updated the Test Plan above! |
replaces #6751
this adds basic support for browser sync, using https://github.com/brave/sync
Fix #1854
Test Plan:
Setup
npm install
has been run. it also downloads the sync library.Test
todos before public release (not necessarily before merge)