hoodiehq / faq

Frequently asked questions about Hoodie
faq.hood.ie
11 stars 3 forks source link

Demo app does not always sync todo items #124

Open garth opened 8 years ago

garth commented 8 years ago

Hoodie Version: 0.6.3 (node v5.2.0, npm 2.14.15, platform: darwin) CouchDB Version 1.6.1

Steps to reproduce:

  1. Create a new hoodie app with the default settings and start it
  2. Open in a browser and create a new account
  3. Open a second browser (either different browser or incognito) an log in
  4. Add todo in 1st window
  5. Add todo in 2nd window

Result:

Sometimes they sync, usually they don't until the page is manually reloaded.

Guria commented 8 years ago

gr2m commented 8 years ago

hmmm that should be very solid. Do you see any request errors in the browser console?

garth commented 8 years ago

No errors and we tried it in several different environments with the same results each time

Guria commented 8 years ago

You can check it yourself on:

gr2m commented 8 years ago

Thanks you two, that is super helpful. I'll have a look if I find something obvious, but note that we are currently working on a new Hoodie version, which will have a much much much more robust sync architecture, because it will use PouchDB instead of our self-cookied localStorage-based solution. The store module is pretty much finished already, you can play with it here: https://github.com/hoodiehq/hoodie-standalone-store

garth commented 8 years ago

@gr2m Thanks for the info, I was under the impression that you were already using pouchdb, so was quite surprised that it wasn't working as expected (I had good experiences with pouch in the past).

Are we better off going with vanilla couch+pouch for the time being or is the hoodie-standalone-store + hoodie-client-store is a reasonable state?

Also it looks like the new setup might play nice with webpack which will be great.

gr2m commented 8 years ago

yeah the new setup should be much easier with webpack & browserify.

I’d say hoodie-standalone-store is great if all you need is databases that you share with others by secret IDs. If you want offline-first, you get cool APIs like hasLocalChanges. But note that the Hoodie community also made two PouchDB plugins that you can also use without the Hoodie back-end part:

And you can also use https://github.com/hoodiehq/hoodie-client-store without the back-end part, directly against a PouchDB. https://github.com/hoodiehq/hoodie-server-store is simply a very tiny proxy to CouchDB anyway at this point

I'd give these a try, they are all in very good state, well tested & documented

gr2m commented 8 years ago

Hey there, just a quick note that we are making progress on the new hoodie: https://github.com/hoodiehq/my-first-hoodie/tree/something-tracker#local-setup-to-test-new-hoodie

probably sync won’t work at all, but if you run into bugs, they should be easy to identify & fix now. It’s a great time to get involved into Hoodie, and I’m happy to help you find your way around the new architecture. A good start is here: https://github.com/hoodiehq/hoodie#why-is-there-no-code-in-this-repository