derbyjs / racer

Realtime model synchronization engine for Node.js
1.19k stars 118 forks source link

bugfix: pubSub don't init data if error, creating speculative objcts #19

Closed re1ro closed 12 years ago

nateps commented 12 years ago

The first commit fixed a bug, but the second commit does not appear necessary. I can't reproduce in the latest version. I fixed the first bug separetly in https://github.com/codeparty/racer/commit/9c31b6a88a80c34ba943d9978a76e09a37ec6965

nateps commented 12 years ago

@rma4ok can you try testing again from head and see if you can still reproduce the bug?

re1ro commented 12 years ago

Yep. Bug still exist but I can reproduce only with racer db adaptor connected.

re1ro commented 12 years ago

I think it's because by custom db adapter. Let me look through more

re1ro commented 12 years ago

If you can take a look and say me what I am missing? https://gist.github.com/cc62d5c99a66315bb78a

re1ro commented 12 years ago

I found it! I dropped EventEmitter prototype. That's why

...
  EventEmitter.call this
...
  __proto__: EventEmitter::
...

Thanks for your cooperation!

Could you please next time pay attention on pull requests faster? rma4ok opened this pull request 18 days ago

nateps commented 12 years ago

@rma4ok We've been going through quite a lot of craziness over the past few weeks, but we'll do our best. Thanks for your interest, and your help with fixing bugs!

re1ro commented 12 years ago

If you have some time. Would you please be so kind to take a look at https://gist.github.com/cc62d5c99a66315bb78a

EventEmitter didn't help really I replaced my internal api adapter with just static user data.

To use it in server/index.coffee

derby.use(require '../racer-db')

app.createStore
    listen: server
    db    :
      type: 'Fondu'

I still have that bug

model.set '_IAmGonnaDisappear', 'Pleaseee! Nooooo!!'
console.log model.get()
model.fetch 'path' , ->
  console.log model.get()