Update ReactiveCache call sites to use async/await for Meteor 3.0

Part 3 of ReactiveCache async migration:
- Add await before all ReactiveCache.getX() calls
- Make functions containing ReactiveCache calls async
- Convert forEach/map/filter loops with async callbacks to for...of
- Update model helpers, Meteor methods, JsonRoutes handlers
- Update collection hooks (.before/.after insert/update/remove)
- Update .allow() callbacks to async

Files updated across models/ and server/ directories:
- Model files: cards, boards, lists, swimlanes, activities, users,
  checklists, checklistItems, customFields, attachments, integrations,
  cardComments, settings files, creators, exporters, and more
- Server files: publications, methods, notifications, routes, migrations
This commit is contained in:
Harry Adel 2026-02-01 00:54:38 +02:00
parent 2f6e34c5f5
commit 71eb01e233
81 changed files with 2218 additions and 2148 deletions

View file

@ -30,14 +30,14 @@ runOnServer(function() {
* @param {string} boardId the ID of the board we are exporting
* @param {string} authToken the loginToken
*/
Picker.route('/api/boards/:boardId/exportExcel', function (params, req, res) {
Picker.route('/api/boards/:boardId/exportExcel', async function (params, req, res) {
const boardId = params.boardId;
let user = null;
let impersonateDone = false;
let adminId = null;
// First check if board exists and is public to avoid unnecessary authentication
const board = ReactiveCache.getBoard(boardId);
const board = await ReactiveCache.getBoard(boardId);
if (!board) {
res.end('Board not found');
return;
@ -64,14 +64,14 @@ runOnServer(function() {
}
const hashToken = Accounts._hashLoginToken(loginToken);
user = ReactiveCache.getUser({
user = await ReactiveCache.getUser({
'services.resume.loginTokens.hashedToken': hashToken,
});
adminId = user._id.toString();
impersonateDone = ReactiveCache.getImpersonatedUser({ adminId: adminId });
impersonateDone = await ReactiveCache.getImpersonatedUser({ adminId: adminId });
} else if (!Meteor.settings.public.sandstorm) {
Authentication.checkUserId(req.userId);
user = ReactiveCache.getUser({
user = await ReactiveCache.getUser({
_id: req.userId,
isAdmin: true,
});