Debugging page reload after collection update

Beginner here.

I have a really old meteor app (updated now) that I am trying to debug. There is a method call inside a template that after the call forces a page reload.

Its a simple‘server.method’, 1, 2)

And on the server there is:

    'server.method'(siteid, name, XXX ) {
            if (!this.userId) {
                throw new Meteor.Error('Not authorized.');
            Sites.update(siteid, {
                $set: {


The code works, but after the update of the collection, the page refreshes un-intentionally.

I am stuck on finding what actually triggers the page reload.

  1. check any publication that publishes a cursor coming from Sites


  1. check if autopublish package is added under .meteor/packages

Thanks @rjdavid

The autopublish is not enabled for sure.

I only have one publication the touches sites, which looks like this:

if (Meteor.isServer) {
    // This code only runs on the server

    Meteor.publish('sites', function sitesPublication() {

        if (!this.userId) {
            throw new Meteor.Error('not-authorized');

        if (this.userId == "superadmin") 
            returnval = Sites.find({ active: { $eq: true } });
        } else {
            returnval = Sites.find({
                $and: [
                    { active: { $eq: true } },
                    { owner: { $eq: this.userId } }

        return returnval;

Could this publication trigger a page reload from the above update?

Did some more investigation.

Changing the publish function to a .find({},{}) with no extra fuzz did not change anything, suspecting that the queries triggered an update.

Realizing that the page is refreshed if I change in the mongodb sites collection.

So, re-iterating on the question, how can I avoid a page-reload on the change of the site collection, and just have an update of the few page-details, as with other collections I use on the same page.

Seems like you are differentiating between reload and refresh. When you say reload, is it similar behavior to Ctrl+r on the browser?

I think you are spot on. I have a long list of entities (represented by one component) these are collapsed or expanded and that is stored in a component state, default value is collapsed and set in the component constructor.

The problem appears when the collection is updated, as all component-constructors are called and all components are then collapsed, despite that fact that some of them was expanded by the user.

Any tricks to avoid this constructor call @rjdavid ?

Check how your UI is mounting and un-mounting your components. It means that a parent component is unmounting and mounting your components.

Hmm, I want to know more about that topic of when components are actually mounted or un-mounted by the parent, can you advice me to good docs, I cannot find anything.

Thanks @rjdavid for standing by.

I found my problem, I had generated unique key values for component mounts based on time, which changed for every render - I feel stupid.