Skip to content

Commit

Permalink
chore: bump meteor and node version (RocketChat#34048)
Browse files Browse the repository at this point in the history
Co-authored-by: Diego Sampaio <[email protected]>
Co-authored-by: Marcos Spessatto Defendi <[email protected]>
  • Loading branch information
3 people authored Jan 3, 2025
1 parent b04342c commit c5f23ab
Show file tree
Hide file tree
Showing 136 changed files with 480 additions and 1,471 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/ci-code-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,27 @@ jobs:
typecheck-cache-${{ runner.OS }}
typecheck-cache
- name: Install Meteor
if: matrix.check == 'ts'
shell: bash
run: |
# Restore bin from cache
set +e
METEOR_SYMLINK_TARGET=$(readlink ~/.meteor/meteor)
METEOR_TOOL_DIRECTORY=$(dirname "$METEOR_SYMLINK_TARGET")
set -e
LAUNCHER=$HOME/.meteor/$METEOR_TOOL_DIRECTORY/scripts/admin/launch-meteor
if [ -e $LAUNCHER ]
then
echo "Cached Meteor bin found, restoring it"
sudo cp "$LAUNCHER" "/usr/local/bin/meteor"
else
echo "No cached Meteor bin found."
fi
# only install meteor if bin isn't found
command -v meteor >/dev/null 2>&1 || curl https://install.meteor.com | sed s/--progress-bar/-sL/g | /bin/sh
- name: TS TypeCheck
if: matrix.check == 'ts'
run: yarn turbo run typecheck
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-deploy-gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Setup NodeJS
uses: ./.github/actions/setup-node
with:
node-version: 20.18.0
node-version: 22.11.0
deno-version: 1.37.1
cache-modules: true
install: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ jobs:
uses: ./.github/actions/setup-node
if: github.event.action != 'closed'
with:
node-version: 20.18.0
node-version: 22.11.0
deno-version: 1.37.1
cache-modules: true
install: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/new-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: Setup NodeJS
uses: ./.github/actions/setup-node
with:
node-version: 20.18.0
node-version: 22.11.0
deno-version: 1.37.1
cache-modules: true
install: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-update-description.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Setup NodeJS
uses: ./.github/actions/setup-node
with:
node-version: 20.18.0
node-version: 22.11.0
deno-version: 1.37.1
cache-modules: true
install: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Setup NodeJS
uses: ./.github/actions/setup-node
with:
node-version: 20.18.0
node-version: 22.11.0
deno-version: 1.37.1
cache-modules: true
install: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-candidate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Setup NodeJS
uses: ./.github/actions/setup-node
with:
node-version: 20.18.0
node-version: 22.11.0
deno-version: 1.37.1
cache-modules: true
install: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-version-durability.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Use Node.js
uses: actions/[email protected]
with:
node-version: '20.18.0'
node-version: '22.11.0'

- name: Install dependencies
run: |
Expand Down
13 changes: 0 additions & 13 deletions .yarn/patches/mongodb-npm-4.17.2-40d1286d70.patch

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
diff --git a/mongodb.d.ts b/mongodb.d.ts
index dd080b553309594c28093365ea101adec5c0a20c..20a616de8c97ec68629c01a848ea8df4fe122bf2 100644
index 8d68644d312c22d8c8c992ef0bc78431bffa2cf4..3f0a5664cd04bb2abb155288e3c245be72e8549f 100644
--- a/mongodb.d.ts
+++ b/mongodb.d.ts
@@ -5539,7 +5539,7 @@ export declare interface MonitorOptions extends Omit<ConnectionOptions, 'id' | '
@@ -6661,7 +6661,7 @@ export declare interface MonitorOptions extends Omit<ConnectionOptions, 'id' | '
* depth any helpers that make use of NestedPaths should devolve to not asserting any
* type safety on the input.
*/
-export declare type NestedPaths<Type, Depth extends number[]> = Depth['length'] extends 8 ? [] : Type extends string | number | boolean | Date | RegExp | Buffer | Uint8Array | ((...args: any[]) => any) | {
+export declare type NestedPaths<Type, Depth extends number[]> = Depth['length'] extends 1 ? [] : Type extends string | number | boolean | Date | RegExp | Buffer | Uint8Array | ((...args: any[]) => any) | {
-export declare type NestedPaths<Type, Depth extends number[]> = Depth['length'] extends 8 ? [] : Type extends string | number | bigint | boolean | Date | RegExp | Buffer | Uint8Array | ((...args: any[]) => any) | {
+export declare type NestedPaths<Type, Depth extends number[]> = Depth['length'] extends 4 ? [] : Type extends string | number | bigint | boolean | Date | RegExp | Buffer | Uint8Array | ((...args: any[]) => any) | {
_bsontype: string;
} ? [] : Type extends ReadonlyArray<infer ArrayType> ? [] | [number, ...NestedPaths<ArrayType, [...Depth, 1]>] : Type extends Map<string, any> ? [string] : Type extends object ? {
[Key in Extract<keyof Type, string>]: Type[Key] extends Type ? [Key] : Type extends Type[Key] ? [Key] : Type[Key] extends ReadonlyArray<infer ArrayType> ? Type extends ArrayType ? [Key] : ArrayType extends Type ? [Key] : [
2 changes: 1 addition & 1 deletion apps/meteor/.docker-mongo/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:20.18.0-bullseye-slim
FROM node:22.11.0-bullseye-slim

LABEL maintainer="[email protected]"

Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/.docker/Dockerfile.alpine
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:20.18.0-alpine3.20
FROM node:22.11.0-alpine3.20

LABEL maintainer="[email protected]"

Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/.docker/Dockerfile.debian
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ARG DENO_VERSION="1.37.1"

FROM denoland/deno:bin-${DENO_VERSION} as deno

FROM node:20.18.0-bullseye-slim
FROM node:22.11.0-bullseye-slim

LABEL maintainer="[email protected]"

Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/.meteor/release
Original file line number Diff line number Diff line change
@@ -1 +1 @@
METEOR@3.0.4
METEOR@3.1
32 changes: 16 additions & 16 deletions apps/meteor/.meteor/versions
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ [email protected]
[email protected]
[email protected]
[email protected]
[email protected].2
[email protected].3
[email protected]
[email protected]
[email protected]
[email protected].1
[email protected].2
[email protected]
[email protected]
[email protected]
Expand All @@ -17,19 +17,19 @@ [email protected]
[email protected]
[email protected]
[email protected]
[email protected].2
[email protected].3
[email protected]
[email protected]
[email protected].2
[email protected].3
[email protected]
dispatch:[email protected]
[email protected]
[email protected].9
[email protected].10
[email protected]
[email protected]
[email protected]
[email protected]
[email protected].0
[email protected].1
[email protected]
[email protected]
[email protected]
Expand All @@ -44,20 +44,20 @@ [email protected]
kadira:[email protected]
[email protected]
[email protected]
[email protected].1
[email protected].2
[email protected]
[email protected]
meteorhacks:[email protected]
[email protected]
[email protected].1
[email protected].2
[email protected]
[email protected].2
[email protected].3
[email protected]
[email protected].2
mongo-decimal@0.1.4-beta300.7
[email protected].3
mongo-decimal@0.2.0
[email protected]
[email protected]
npm-mongo@4.17.4
npm-mongo@6.10.0
[email protected]
[email protected]
[email protected]
Expand All @@ -82,15 +82,15 @@ [email protected]
[email protected]
[email protected]
[email protected]
[email protected].0
[email protected].1
[email protected]
[email protected]
[email protected]
[email protected]
typescript@5.4.3
typescript@5.6.3
[email protected]
[email protected].4
[email protected].3
[email protected].5
[email protected].4
[email protected]
zodern:[email protected]
zodern:[email protected]
Expand Down
6 changes: 3 additions & 3 deletions apps/meteor/app/api/server/lib/emailInbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,19 +78,19 @@ export const updateEmailInbox = async (

const updatedResponse = await EmailInbox.updateById(_id, updateEmailInbox);

if (!updatedResponse.value) {
if (!updatedResponse) {
throw new Error('error-invalid-email-inbox');
}

void notifyOnEmailInboxChanged(
{
...updatedResponse.value,
...updatedResponse,
...(department === 'All' && { department: undefined }),
},
'updated',
);

return updatedResponse.value;
return updatedResponse;
};

export const removeEmailInbox = async (emailInboxId: IEmailInbox['_id']): Promise<DeleteResult> => {
Expand Down
4 changes: 2 additions & 2 deletions apps/meteor/app/apps/server/bridges/scheduler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { IAppServerOrchestrator } from '@rocket.chat/apps';
import type { IProcessor, IOnetimeSchedule, IRecurringSchedule, IJobContext } from '@rocket.chat/apps-engine/definition/scheduler';
import { StartupType } from '@rocket.chat/apps-engine/definition/scheduler';
import { SchedulerBridge } from '@rocket.chat/apps-engine/server/bridges/SchedulerBridge';
import { ObjectID } from 'bson';
import { ObjectId } from 'bson';
import { MongoInternals } from 'meteor/mongo';

function _callProcessor(processor: IProcessor['processor']): (job: Job) => Promise<void> {
Expand Down Expand Up @@ -159,7 +159,7 @@ export class AppSchedulerBridge extends SchedulerBridge {

let cancelQuery;
try {
cancelQuery = { _id: new ObjectID(jobId.split('_')[0]) };
cancelQuery = { _id: new ObjectId(jobId.split('_')[0]) };
} catch (jobDocIdError) {
// it is not a valid objectid, so it won't try to cancel by document id
cancelQuery = { name: jobId };
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/app/apps/server/bridges/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export class AppSettingBridge extends ServerSettingBridge {
throw new Error(`The setting "${id}" is not readable.`);
}

const { value: setting } = await Settings.incrementValueById(id, value, { returnDocument: 'after' });
const setting = await Settings.incrementValueById(id, value, { returnDocument: 'after' });
if (setting) {
void notifyOnSettingChanged(setting);
}
Expand Down
3 changes: 2 additions & 1 deletion apps/meteor/app/assets/server/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,8 @@ const listener = (req: IncomingMessage, res: ServerResponse, next: NextHandleFun

if (asset && Array.isArray(asset.constraints.extensions) && !asset.constraints.extensions.includes(format)) {
res.writeHead(403);
return res.end();
res.end();
return;
}
if (!file) {
const defaultUrl = asset?.defaultUrl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { deleteRoom } from '../../../lib/server/functions/deleteRoom';
import { notifyOnMessageChange } from '../../../lib/server/lib/notifyListener';

const updateAndNotifyParentRoomWithParentMessage = async (room: IRoom): Promise<void> => {
const { value: parentMessage } = await Messages.refreshDiscussionMetadata(room);
const parentMessage = await Messages.refreshDiscussionMetadata(room);
if (!parentMessage) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,7 @@ export const provideUsersSuggestedGroupKeys = async (

const usersWithSuggestedKeys = [];
for await (const user of usersSuggestedGroupKeys[roomId]) {
const { value } = await Subscriptions.setGroupE2ESuggestedKeyAndOldRoomKeys(
user._id,
roomId,
user.key,
parseOldKeysDates(user.oldKeys),
);
const value = await Subscriptions.setGroupE2ESuggestedKeyAndOldRoomKeys(user._id, roomId, user.key, parseOldKeysDates(user.oldKeys));
if (!value) {
continue;
}
Expand Down
8 changes: 4 additions & 4 deletions apps/meteor/app/e2e/server/functions/resetRoomKey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ export async function resetRoomKey(roomId: string, userId: string, newRoomKey: s
// And set the new key to the user that called the func
const result = await Subscriptions.setE2EKeyByUserIdAndRoomId(userId, roomId, newRoomKey);

if (result.value) {
void notifyOnSubscriptionChanged(result.value);
if (result) {
void notifyOnSubscriptionChanged(result);
}
if (roomResult.value) {
void notifyOnRoomChanged(roomResult.value);
if (roomResult) {
void notifyOnRoomChanged(roomResult);
}
}

Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/app/e2e/server/methods/updateGroupKey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export async function updateGroupKey(rid: string, uid: string, key: string, call
}

// uid also has subscription to this room
const { value } = await Subscriptions.setGroupE2ESuggestedKey(uid, rid, key);
const value = await Subscriptions.setGroupE2ESuggestedKey(uid, rid, key);
if (value) {
void notifyOnSubscriptionChanged(value);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { settings } from '../../../settings/server';

const incException = throttledCounter((counter) => {
Settings.incrementValueById('Uncaught_Exceptions_Count', counter, { returnDocument: 'after' })
.then(({ value }) => {
.then((value) => {
if (value) {
settings.set(value);
}
Expand Down
Loading

0 comments on commit c5f23ab

Please sign in to comment.