Note that there are some explanatory texts on larger screens.

plurals
  1. POMeteor exception in Meteor.flush when updating a collection breaks reactivity across clients
    primarykey
    data
    text
    <p>When I'm calling Collection.update from the front end (the method call is allowed), the update does work ok, but the exception below is being thrown (in Chrome's JS console, not in the server). Although the update took place, other clients connected to the same collection do not see the updates until they refresh the browser - I suspect because of the exception. </p> <p>Any idea what might cause this? </p> <pre><code>Exception from Meteor.flush: Error: Can't create second landmark in same branch at Object.Spark.createLandmark (http://checkadoo.com/packages/spark/spark.js?8b4e0abcbf865e6ad778592160ec3b3401d7abd2:1085:13) at http://checkadoo.com/packages/templating/deftemplate.js?7f4bb363e9e340dbaaea8d74ac670af40ac82d0a:115:26 at Object.Spark.labelBranch (http://checkadoo.com/packages/spark/spark.js?8b4e0abcbf865e6ad778592160ec3b3401d7abd2:1030:14) at Object.partial [as list_item] (http://checkadoo.com/packages/templating/deftemplate.js?7f4bb363e9e340dbaaea8d74ac670af40ac82d0a:114:24) at http://checkadoo.com/packages/handlebars/evaluate.js?ab265dbab665c32cfd7ec343166437f2e03f1a54:349:48 at Object.Spark.labelBranch (http://checkadoo.com/packages/spark/spark.js?8b4e0abcbf865e6ad778592160ec3b3401d7abd2:1030:14) at branch (http://checkadoo.com/packages/handlebars/evaluate.js?ab265dbab665c32cfd7ec343166437f2e03f1a54:308:20) at http://checkadoo.com/packages/handlebars/evaluate.js?ab265dbab665c32cfd7ec343166437f2e03f1a54:348:20 at Array.forEach (native) at Function._.each._.forEach (http://checkadoo.com/packages/underscore/underscore.js?772b2587aa2fa345fb760eff9ebe5acd97937243:76:11) </code></pre> <p><strong>EDIT 2</strong></p> <p>The error will also occur if the update call is run in the console. It happens on the first run of the update but by then reactivity is broken on any other browser attached to it. </p> <p><strong>EDIT</strong> Here is my template for the clickable item that triggers the update:</p> <pre><code>&lt;template name="list_item"&gt; &lt;li class="checklistitemli"&gt; &lt;div class="{{checkbox_class}}" id="clitem_{{index}}"&gt; &lt;input type="checkbox" name="item_checked" value="1" id="clcheck_{{index}}" class="checklist_item_check" {{checkbox_ticked}}&gt; {{title}} &lt;/div&gt; &lt;/li&gt; &lt;/template&gt; </code></pre> <p>and here's the event handler for clicks on 'list_item':</p> <pre><code>Template.list_item.events = { 'click .checklistitem' : function(ev) { this.checked = !this.checked; var updateItem = {}; updateItem['items.'+this.index+'.checked'] = this.checked; console.log("The error happens here"); Lists.update({_id: this._id}, {$set:updateItem}, {multi:false} , function(err) { console.log("In callback, after the error"); }); } } </code></pre> <p>The whole thing is available at <a href="http://checkadoo.com" rel="nofollow">http://checkadoo.com</a> (Its a port of a Tornado based Python app of mine)</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.
 

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