Note that there are some explanatory texts on larger screens.

plurals
  1. POMeteor observeChanges() called twice when it should be called once
    primarykey
    data
    text
    <p>The newest meteor's observeChanges cursor method appears to be being called twice, I'm unsure why.</p> <p>In a client only file, theres the following code:</p> <pre><code>Meteor.startup(function () { //TODO BROKEN CodeFiles.find({_id: Session.get('currentFile')}).observeChanges({ changed: function(id, fields) { console.log("Codefile changed"); console.log(fields); } }); }); </code></pre> <p>Which results in the following in my browser,</p> <pre><code>Codefile changed client.js:165 Object {edits: Object} client.js:166 XHR finished loading: "http://localhost:3000/sockjs/991/bm7f2oa8/xhr_send". sockjs-0.3.4.js:821 XHR finished loading: "http://localhost:3000/sockjs/991/bm7f2oa8/xhr". sockjs-0.3.4.js:821 Codefile changed client.js:165 Object {} </code></pre> <p>As you can see, the observeChanges method is called twice, once with the correct edit object, correct data included. A second time with a blank object. This isn't a huge problem, as I can check for an empty object and compensate, but I'd rather fix the underlying problem.</p> <p>Full code open-source and viewable here: <a href="https://github.com/joeljfischer/meteor-collabmirror/tree/c07814863e19cdd252f9410ccc15a73b34656e18" rel="nofollow" title="Github commit link">Github commit link</a></p> <p>Note the specific commit number if you run the code to see the issue in the javascript console. In later commits I'm just doing an undefined check, but I would like the see the root issue resolved, as sending over useless data is an issue.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload