Run into this strange error just recently. I'm subscribed to profiles collection (from socialize:profiles - have it locally for Meteor 3) through the app. In my text editor I have triggered a function to change a field on my profile like this:
Meteor.methods({
'profile.readerSettings.darkMode': async (setTo: boolean) => {
check(setTo, Boolean)
const userId = Meteor.userId()
if (!userId) throw notAuthorized
return await ProfilesCollection.updateAsync(
{ _id: userId },
{ $set: { 'readerSettings.darkMode': setTo } },
)
},
})
Strangely though the profile document gets replaced with the change and two extra fields. Which results in other important fields missing. Calling other methods around the editor that also change the readerSettings then adds other fields back in.
Removing and adding the package seemed to fix the issue (which is why I was able to pin it to this package).
Then I found that if the offline package is last in the packages file then the problem does not occur. So maybe the package needs to be loaded after all the packages with collections have been loaded to prevent this issue?
Run into this strange error just recently. I'm subscribed to profiles collection (from
socialize:profiles- have it locally for Meteor 3) through the app. In my text editor I have triggered a function to change a field on my profile like this:Strangely though the profile document gets replaced with the change and two extra fields. Which results in other important fields missing. Calling other methods around the editor that also change the
readerSettingsthen adds other fields back in.Removing and adding the package seemed to fix the issue (which is why I was able to pin it to this package).
Then I found that if the offline package is last in the packages file then the problem does not occur. So maybe the package needs to be loaded after all the packages with collections have been loaded to prevent this issue?