From 54e88d02a0e109c873da9f2155dab62f5d43840c Mon Sep 17 00:00:00 2001 From: Julian Waller Date: Mon, 16 Dec 2024 10:44:19 +0000 Subject: [PATCH] fix: simplify meteor collection auth checks This removes some deprecation warnings See https://github.com/meteor/meteor/issues/13444 --- meteor/.meteor/packages | 10 +++++----- meteor/.meteor/release | 2 +- meteor/.meteor/versions | 14 +++++++------- meteor/server/collections/collection.ts | 12 +++++------- 4 files changed, 18 insertions(+), 20 deletions(-) diff --git a/meteor/.meteor/packages b/meteor/.meteor/packages index 34ab0cf5f5..1e161100bf 100644 --- a/meteor/.meteor/packages +++ b/meteor/.meteor/packages @@ -8,14 +8,14 @@ # but you can also edit it by hand. -meteor@2.0.1 -webapp@2.0.3 +meteor@2.1.0-beta311.1 +webapp@2.0.4 ddp@1.4.2 -mongo@2.0.2 # The database Meteor supports right now +mongo@2.1.0-beta311.1 # The database Meteor supports right now -ecmascript@0.16.9 # Enable ECMAScript2015+ syntax in app code -typescript@5.4.3 # Enable TypeScript syntax in .ts and .tsx modules +ecmascript@0.16.10 # Enable ECMAScript2015+ syntax in app code +typescript@5.6.3 # Enable TypeScript syntax in .ts and .tsx modules tracker@1.3.4 # Meteor's client-side reactive programming library diff --git a/meteor/.meteor/release b/meteor/.meteor/release index 8d20e1a2d3..63c7f1175b 100644 --- a/meteor/.meteor/release +++ b/meteor/.meteor/release @@ -1 +1 @@ -METEOR@3.1 +METEOR@3.1.1-beta.1 diff --git a/meteor/.meteor/versions b/meteor/.meteor/versions index 93c057c752..53972c2a32 100644 --- a/meteor/.meteor/versions +++ b/meteor/.meteor/versions @@ -1,4 +1,4 @@ -allow-deny@2.0.0 +allow-deny@2.1.0-beta311.1 babel-compiler@7.11.2 babel-runtime@1.5.2 base64@1.0.13 @@ -8,9 +8,9 @@ callback-hook@1.6.0 check@1.4.4 core-runtime@1.0.0 ddp@1.4.2 -ddp-client@3.0.3 +ddp-client@3.1.0-beta311.1 ddp-common@1.4.4 -ddp-server@3.0.3 +ddp-server@3.1.0-beta311.1 diff-sequence@1.1.3 dynamic-import@0.7.4 ecmascript@0.16.10 @@ -24,16 +24,16 @@ geojson-utils@1.0.12 id-map@1.2.0 inter-process-messaging@0.1.2 logging@1.3.5 -meteor@2.0.2 +meteor@2.1.0-beta311.1 minimongo@2.0.2 modern-browsers@0.1.11 modules@0.20.3 modules-runtime@0.13.2 -mongo@2.0.3 +mongo@2.1.0-beta311.1 mongo-decimal@0.2.0 mongo-dev-server@1.1.1 mongo-id@1.0.9 -npm-mongo@6.10.0 +npm-mongo@6.10.2-beta311.1 ordered-dict@1.2.0 promise@1.0.0 random@1.2.2 @@ -41,7 +41,7 @@ react-fast-refresh@0.2.9 reload@1.3.2 retry@1.1.1 routepolicy@1.1.2 -socket-stream-client@0.5.3 +socket-stream-client@0.6.0-beta311.1 tracker@1.3.4 typescript@5.6.3 webapp@2.0.4 diff --git a/meteor/server/collections/collection.ts b/meteor/server/collections/collection.ts index 8ae8aae4a8..2afddb3518 100644 --- a/meteor/server/collections/collection.ts +++ b/meteor/server/collections/collection.ts @@ -112,13 +112,11 @@ function setupCollectionAllowRules['allow']>[0]*/ = { - update: () => false, - updateAsync: origUpdate - ? (userId: string | null, doc: DBInterface, fieldNames: string[], modifier: any) => - origUpdate(protectString(userId), doc, fieldNames as any, modifier) as any + const options: Parameters['allow']>[0] = { + update: origUpdate + ? async (userId: string | null, doc: DBInterface, fieldNames: string[], modifier: any) => { + return origUpdate(protectString(userId), doc, fieldNames as any, modifier) + } : () => false, }