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

Sync tests have failures #11118

Closed
luixxiul opened this issue Sep 24, 2017 · 7 comments
Closed

Sync tests have failures #11118

luixxiul opened this issue Sep 24, 2017 · 7 comments

Comments

@luixxiul
Copy link
Contributor

luixxiul commented Sep 24, 2017

Updated issue description

Some sync tests are failing

Steps to reproduce

  1. Fresh local install (rm -rf ~/node_modules, rm ~/Library/Application Support/brave-development, etc... and npm install)
  2. window 1, run npm run watch-test
  3. window 2 run npm run test -- --grep="Syncing"
  4. Notice errors:
  1) Syncing bookmarks "before all" hook:
     Error: element ("[data-test-id="syncTabButton"]") still not visible after 10000ms
      at elements("[data-test-id="syncTabButton"]") - isVisible.js:54:17
      at isVisible("[data-test-id="syncTabButton"]") - waitForVisible.js:73:22

  2) Syncing bookmarks from an existing profile "before all" hook:
     TypeError: Cannot read property 'selector' of undefined
      at window("CDwindow-(59B992D69A2F81D58950FD508FE0C150)") - brave.js:248:27
      at url() - getUrl.js:30:28
      at getUrl() - brave.js:283:40

  3) Syncing then turning it off stops syncing "before all" hook:
     Error: Promise was rejected with the following reason: timeout
      at windowHandles() - brave.js:279:32

  4) Syncing then turning it off, then turning it on sends new records "before all" hook:
     TypeError: Cannot read property 'selector' of undefined
      at window("CDwindow-(8B440EFA86C1C31E1F19B4D2B5DE6C0E)") - brave.js:248:27
      at url() - getUrl.js:30:28
      at getUrl() - brave.js:283:40

Original issue description

Description

Sync causes an uncaught exception.

If you restart the browser, the browser gets stuck with this error and it does not respond.

reloading sync
sync 1506259983783: initialized deviceId 0
sync 1506259983783: initialized userId Y5/GM+Hlc/4y5ggmIxyRGbNH9tGhcMSaO0IiCJHCgNA=
sync 1506259984764: successfully authenticated userId: Y5/GM+Hlc/4y5ggmIxyRGbNH9tGhcMSaO0IiCJHCgNA=
sync 1506259984764: using AWS bucket: brave-sync-staging
sync 1506259984764: set device ID: 0
sync 1506259984765: Sending 1 sync records
sync 1506259984766: success
An uncaught exception occurred in the main process Uncaught Exception:
TypeError: Cannot read property 'forEach' of undefined
    at Immutable.Map.withMutations.objectsById (/Users/Suguru/browser-laptop/js/state/syncUtil.js:398:34)
    at Map.withMutations (/Users/Suguru/browser-laptop/node_modules/immutable/dist/immutable.js:1355:7)
    at Object.module.exports.createObjectCache (/Users/Suguru/browser-laptop/js/state/syncUtil.js:396:43)
    at handleAppAction (/Users/Suguru/browser-laptop/js/stores/appStore.js:625:27)
    at callbacks.forEach (/Users/Suguru/browser-laptop/js/dispatcher/appDispatcher.js:107:7)
    at Array.forEach (<anonymous>)
    at AppDispatcher.dispatchToOwnRegisteredCallbacks (/Users/Suguru/browser-laptop/js/dispatcher/appDispatcher.js:106:20)
    at AppDispatcher.dispatchInternal (/Users/Suguru/browser-laptop/js/dispatcher/appDispatcher.js:132:10)
    at async.cargo (/Users/Suguru/browser-laptop/js/dispatcher/appDispatcher.js:213:19)
    at process (/Users/Suguru/browser-laptop/node_modules/async/dist/async.js:2317:17)
sync 1506259984769: Sending 1 records
sync 1506259984777: fetching devices
sync 1506259984795: fetching BOOKMARKS,PREFERENCES records after 0
sync 1506259985495: sending record: {"action":0,"device":{"name":"Mac Laptop"},"deviceId":{"0":0},"objectId":{"0":198,"1":84,"2":70,"3":200,"4":32,"5":4,"6":126,"7":246,"8":99,"9":250,"10":174,"11":131,"12":211,"13":57,"14":61,"15":213}}
sync 1506259985670: fetched 1 devices
sync 1506259985672: got 0 decrypted records in BOOKMARKS after 0
sync 1506259985673: getting existing objects for 0 BOOKMARKS
sync 1506259985832: got 1 decrypted records in PREFERENCES after 0
sync 1506259985832: getting existing objects for 1 PREFERENCES
sync 1506259985834: resolved 1 PREFERENCES -> 1

Steps to Reproduce

  1. rm -rf node_modules && rm -rf ~/.electron && npm i
  2. npm run watch and npm start
  3. Open about:preferences#sync
  4. Enable Sync

Actual result:

The device does not appear on the devices list.

If you restart the browser, the browser gets stuck with that error and it does not respond.

Expected result:

Reproduces how often: [What percentage of the time does it reproduce?]

100% for me. Travis runs reproduce the same issue.

Brave Version

about:brave info:

Brave: 0.21.0
V8: 6.1.534.32
rev: 82d2eac
Muon: 4.4.19
OS Release: 16.7.0
Update Channel: Release
OS Architecture: x64
OS Platform: macOS
Node.js: 7.9.0
Brave Sync: v1.3.5
libchromiumcontent: 61.0.3163.79

Reproducible on current live release:

It is not reproduced for me.

Additional Information

Adding the milestone following the instruction by @bbondy

@luixxiul
Copy link
Contributor Author

@ghost ghost modified the milestones: 0.19.x (Beta Channel), 0.21.x (Nightly Channel) Sep 26, 2017
@ghost ghost added the priority/P2 Crashes. Loss of data. Severe memory leak. label Sep 26, 2017
@luixxiul
Copy link
Contributor Author

luixxiul commented Oct 6, 2017

https://community.brave.com/t/unable-to-set-focus-on-syncdevicenameinput-text-field-with-mouse-click/8648?u=suguru

Unable to set focus on syncDeviceNameInput text field with mouse click

Running Beta 0.21.0 locally.

Steps to reproduce:

  • Click on Sync code words(textarea) and enter code from another device(or installation).
  • Clicking on syncDeviceNameInput text field will not change the focus.

Workaround:

  • Use tab to switch to name field.

See cast for more info: https://cl.ly/mugg

Works as expected in 0.18.36

Brave: 0.21.0
V8: 6.1.534.41
rev: 29bdbd5
Muon: 4.4.25
OS Release: 16.7.0
Update Channel: Release
OS Architecture: x64
OS Platform: macOS
Node.js: 7.9.0
Brave Sync: v1.3.5
libchromiumcontent: 61.0.3163.100

@bbondy bbondy modified the milestones: 0.21.x (Developer Channel), 0.20.x (Beta Channel) Oct 25, 2017
@alexwykoff
Copy link
Contributor

@luixxiul is this only in 0.20.x ?

@luixxiul
Copy link
Contributor Author

As far as the sync tests fail on Travis, this issue seems to be reproduced on other branches.

@bsclifton bsclifton assigned bsclifton and unassigned luixxiul Dec 22, 2017
@bsclifton
Copy link
Member

Unable to reproduce - I tested with current version of 0.20.x (9bb3c67) and also with the packaged build (both on a clean profile).

@bsclifton
Copy link
Member

Confirmed this also works as expected with master

@bsclifton bsclifton removed this from the 0.20.x (Beta Channel) milestone Dec 26, 2017
@bsclifton bsclifton removed priority/P2 Crashes. Loss of data. Severe memory leak. release/blocking labels Dec 26, 2017
@bsclifton
Copy link
Member

bsclifton commented Dec 26, 2017

I can confirm some of the tests are broken:

  1) Syncing bookmarks "before all" hook:
     Error: element ("[data-test-id="syncTabButton"]") still not visible after 10000ms
      at elements("[data-test-id="syncTabButton"]") - isVisible.js:54:17
      at isVisible("[data-test-id="syncTabButton"]") - waitForVisible.js:73:22

  2) Syncing bookmarks from an existing profile "before all" hook:
     TypeError: Cannot read property 'selector' of undefined
      at window("CDwindow-(59B992D69A2F81D58950FD508FE0C150)") - brave.js:248:27
      at url() - getUrl.js:30:28
      at getUrl() - brave.js:283:40

  3) Syncing then turning it off stops syncing "before all" hook:
     Error: Promise was rejected with the following reason: timeout
      at windowHandles() - brave.js:279:32

  4) Syncing then turning it off, then turning it on sends new records "before all" hook:
     TypeError: Cannot read property 'selector' of undefined
      at window("CDwindow-(8B440EFA86C1C31E1F19B4D2B5DE6C0E)") - brave.js:248:27
      at url() - getUrl.js:30:28
      at getUrl() - brave.js:283:40

I updated issue title and description

@bsclifton bsclifton changed the title Sync causes an uncaught exception Sync tests have failures Dec 26, 2017
@bsclifton bsclifton added this to the Triage Backlog milestone Dec 26, 2017
@bsclifton bsclifton removed their assignment Dec 26, 2017
@bsclifton bsclifton added wontfix and removed wontfix labels Aug 25, 2018
@bsclifton bsclifton removed this from the Triage Backlog milestone Aug 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants