-
-
Notifications
You must be signed in to change notification settings - Fork 77
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
Grounddb throws error, when being used on Meteor.users and with appcache. #22
Comments
I have to check up on this, Meteor.users is a bit special since it resumes methods by itself - the error from live data is Meteor throwing errors for data already found - its an odd thing on the client grounddb overwrites the original meteor code to make offline work. Is the error thrown on client or server? |
The error is thrown on the client. On further investigation it looks like it has nothing to do with Methods being resumed. I added |
Nice catch, I guess it's time for adding client-side conflict resolution, I'll have a look at it next week or so. I'll refactor groundDB at the same time. |
Hi Morten,
I don't really understand how a sync between offline (e.g. localstorage) <-> minimongo <-> mongo should be working, without having some sort of special collection, which logs each change with a version number + timestamp and sends it to the relevant data stores. What are your plans on this one? |
So groundDB is just caching the db and method calls allowing it to resume. The current solution dont have any interface for conflict resolution. It's the tricky part and vary between apps. |
Hi Morten, |
I'm not sure - but I'm going to dig into it soon - Got some deadlines at the moment, but have to use groundDB for a project with deadline within 30 days - so something is bound to happen... |
I have the same issue on another collection, so it's not just related to the users collection. |
I've just pushed the new ground:db - I havent had time yet to test this issue further - It'll prop. be a couple of days before I get to it - so help is much welcome |
Hello @raix , did you manage to dig into this ? I have a project with GroundDB and appcache - Once I log in I do GroundDB(Meteor.users) (on the client side) which successfully inserts the information in the localStorage. But once I go offline and refresh the page - Meteor.user() - returns undefined ( although the information stays in the storage ) |
Its on the todo list - I have to add this to the QA test and figure out whats causing the issue :) |
Would very much appreciate that :) 👍 |
Hmm I've managed to make it work nothing is different though - I just put the GroundDB('users') -> inside lib/collections/users.coffee and I publish the user collection. Now I can't reproduce the failing 🔢 |
So at the moment grounddb is pretty dumb in relations to the user collection - it should wait committing changes when the user that committed those changes logs in... for now it waits 500ms https://github.com/GroundMeteor/db/blob/Meteor-0-9-1/groundDB.client.js#L733-L740 Not sure if this could be the issue - ground:db actually could intercept the meteor.apply 'login' and wait for it to return (if called on connection) - a better solution than a simple wait... // I still havent added a qa test for grounding the users collection - its on the todo :) |
I'm using meteor users and not getting any errors well test some more. |
appears to be an issue with fast-render and grounddb. related thread kadirahq/fast-render#80 EDIT: never mind my stupidity, this was due to a circular ref |
Same issue on different collections too any temporary fix for this? |
@raix any update on this? we're frequently getting |
+1 |
Thank you for this great package.
I tested it with a normal collection and it works like a charm. Only Meteor.users seems to be different when having custom fields in it.
I deployed it to: http://grounddbusertest.meteor.com/ + repo at: https://github.com/akralj/grounddbUserTest
Steps to reproduce (with chrome or safari):
Uncaught Error: It doesn't make sense to be adding something we know exists: 3cKZpRMZmKpRXatwa
livedata.js?a2e72054ba38809f8cac1e9197d52610e3efef8e:4258
groundDB.db.users is being nuked and meteor thinks one is logged out even if Meteor.userId() still exists in localstorage
It seems like Groundb & the normal Meteor sync overlap. I tested it with a a few versions of meteor and grounddb.
Here the main code.
The text was updated successfully, but these errors were encountered: