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

url is not always unique in _syncNodes #52

Closed
martindiphoorn opened this issue Dec 10, 2014 · 4 comments
Closed

url is not always unique in _syncNodes #52

martindiphoorn opened this issue Dec 10, 2014 · 4 comments

Comments

@martindiphoorn
Copy link
Contributor

In some race conditions it is possible that there will be created an seconde entry in the _syncNodes. This happend to me when i was firing an disconnect and a connect right after each other.

Example:
On the login page i tell that sync should be disconnected. However when running from an app it should take the saved credentials and perform an login.

db.syncable.disconnect(url);

// some more code

if (isCordovaApp) {
   // do login
  db.syncable.connect(provider,url);
}

This way i have seen more then one entry for the same url in the _syncNodes objectStore. I have fixed this in my code by changing the order and using the promises returned.

My biggest problem is that after running the resync it sometimes returns all the current object store contents as type 1 or type 3 to the backend in the next sync. When looking closely at it, i noticed that there where 2 sync connections instead off 1.

@martindiphoorn
Copy link
Contributor Author

selectie_018
I just found out that when i do an resync with ngDexie then there will also be 2 sync connections with the same name. Im going to fix this in ngDexie, by keeping a resync state, but maybe with this information you can find out better what is going wrong?

@nponiros
Copy link
Collaborator

@dfahlander does #412 with the unique url index fix this issue? If yes maybe we can close it.

@dfahlander
Copy link
Collaborator

Yes. Thanks. And merry Christmas :)

@nponiros
Copy link
Collaborator

Thanks. Same to you

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

No branches or pull requests

3 participants