[Meteor 1.3.4.1] "Exception in flushing DDP buffered writes" when displaying lot of data

In our system, on one particular page, we need to do a lot of reactivity with multiple collections. For some computers, when we update several records and let the page reactively updated, browsers (chrome and safari) throw this exception

Exception in flushing DDP buffered writes: Error: Expected to find a document to change at Object.update (http://xxx.xxx.xxx.xxx:3000/packages/mongo.js?hash=f257f65490c0d34a164a6d8801ede96905340462:246:29) at Object.store.(anonymous function) [as update] (http://xxx.xxx.xxx.xxx:3000/packages/ddp-client.js?hash=27502404fad7fc072e57e8b0b6719f40d92709c7:3613:48) at http://xxx.xxx.xxx.xxx:3000/packages/ddp-client.js?hash=27502404fad7fc072e57e8b0b6719f40d92709c7:4441:19 at Array.forEach (native) at Function._.each._.forEach (http://xxx.xxx.xxx.xxx:3000/packages/underscore.js?hash=27b3d669b418de8577518760446467e6ff429b1e:149:11) at http://xxx.xxx.xxx.xxx:3000/packages/ddp-client.js?hash=27502404fad7fc072e57e8b0b6719f40d92709c7:4440:13 at Function._.each._.forEach (http://xxx.xxx.xxx.xxx:3000/packages/underscore.js?hash=27b3d669b418de8577518760446467e6ff429b1e:157:22) at Connection._performWrites (http://xxx.xxx.xxx.xxx:3000/packages/ddp-client.js?hash=27502404fad7fc072e57e8b0b6719f40d92709c7:4437:9) at Connection._flushBufferedWrites (http://xxx.xxx.xxx.xxx:3000/packages/ddp-client.js?hash=27502404fad7fc072e57e8b0b6719f40d92709c7:4423:10) at http://xxx.xxx.xxx.xxx:3000/packages/meteor.js?hash=ae8b8affa9680bf9720bd8f7fa112f13a62f71c3:1105:22

while on some computers, everything is fine. Is there anyone suffering this problem before ? We are using meteor 1.3.4.1 with Blaze template. The updating involves sending the data to some Restful server and wait for the response in order to update into mongo

Update: I dont have this problem when downgrading the meteor version to 1.3.2

Update 2: This is not the problem of data load neither. I just cleaned up the database and the page only display 1 or 2 records, but i continuously change the a field of a record and the issue happened again (on 1.3.4.1). Look like the high frequency updating will make the exception happen

Update 3: Now this is funny. If we do the meteor update on the current project to 1.4.0.1, nothing happens and the project run bloody fast. However, when i do the fresh project with 1.4.0.1 and put the old source code into that, the bug starts to happen again (!?!?!?)

2 Likes

someone else has the same problem I think Trouble with reactivity/DDP connections after upgrade to 1.4

Case Closed. It is because of fast-render messed up with the DDP message and altered the message type from added to changed. I have 2 subscriptions connecting to the same publication with the different status/type. Once I switched the status from one to the other, meteor made 2 messages to the client: removed and added for both subscriptions. However, fast render then alter the added into changed, thus when meteor sees the msg type and triggered the changed, since the record was already removed in the previous message, exception will occur. I decided to remove fast render (since we don’t really need it anymore - it is still a good library) and make a safer check on the subscription connection

3 Likes

Thanks! I had identified that multiple publications was the issue, but I will remove fast render from those pages to turn those publications back on.