Related collection emptied when user is updated


#1

I have two collections: users and tradeOffers. Each user has a unique steamid field. Each tradeOffer has field recipient.steamid. On server I publish tradeOffers collection like this:

import { Meteor } from 'meteor/meteor';

import { TradeOffers } from './collection';

if (Meteor.isServer) {
    Meteor.publish("tradeOffers", function () {
        let user = Meteor.users.findOne({_id: this.userId });

        return TradeOffers.find({
            'recipient.steamid': user.services.steam.steamid
        });
    });
}

On client side I subscribe to this collection and display current user’s trade offers. Everything works fine until I update the user. Whenever current user is updated, data disappears from the view. After page reload I can see trade offers again. Any help would be appreciated.


#2

Guys, idk what I changed, guess nothing, but it doesn’t happen now.