fix(users): use updateAsync for Meteor 3 server-side user writes
All checks were successful
build-image / build (push) Successful in 12m38s

Meteor.users.update() is sync-only and no longer exists server-side
under Meteor 3, so it threw on every call, surfacing as a generic
500 to the client. users.setLang runs on every page load for logged-in
users, which is what broke /zones; the same bug in edit-profile.js
was silently breaking /profile too.
This commit is contained in:
vjrj 2026-07-30 10:13:21 +02:00
parent 570cb49764
commit 775461f7b2
2 changed files with 6 additions and 6 deletions

View file

@ -33,9 +33,9 @@ Meteor.methods({
throw new Meteor.Error('500', exception);
});
},
'users.setLang': function userLang(lang) {
'users.setLang': async function userLang(lang) {
check(lang, validLangCode);
Meteor.users.update({ _id: this.userId }, { $set: { lang } });
await Meteor.users.updateAsync({ _id: this.userId }, { $set: { lang } });
},
'auth.getHash': async function getHash() {
const token = Accounts._generateStampedLoginToken();