Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/few-masks-punch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rocket.chat/meteor": major
---

Removes deprecated `canAccessRoom` meteor method
4 changes: 4 additions & 0 deletions .changeset/gold-keys-compare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
"@rocket.chat/meteor": major
---
Removes support of MongoDB versions 5.x and 6.x
5 changes: 5 additions & 0 deletions .changeset/proud-dingos-sell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@rocket.chat/meteor': major
---

Removes the setting `API_Use_REST_For_DDP_Calls`. Turning this on meant websocket was only used for realtime data/events, and any other meteor method calls goes over method.call endpoint. For microservice deployments, this had to be turned on. Now method calls will always happen over http endpoints.
15 changes: 5 additions & 10 deletions .github/workflows/ci-test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ on:
transporter:
type: string
mongodb-version:
default: "['5.0', '7.0']"
default: "['7.0']"
required: false
type: string
release:
Expand All @@ -47,10 +47,6 @@ on:
type:
required: true
type: string
db-watcher-disabled:
default: 'true'
required: false
type: string
secrets:
CR_USER:
required: true
Expand Down Expand Up @@ -86,7 +82,7 @@ jobs:
mongodb-version: ${{ fromJSON(inputs.mongodb-version) }}
shard: ${{ fromJSON(inputs.shard) }}

name: MongoDB ${{ matrix.mongodb-version }}${{ inputs.db-watcher-disabled == 'false' && ' [legacy watchers]' || '' }} (${{ matrix.shard }}/${{ inputs.total-shard }}) - ${{ (matrix.mongodb-version == '7.0' && 'Debian' && false) || 'Alpine (Official)' }}
name: MongoDB ${{ matrix.mongodb-version }} (${{ matrix.shard }}/${{ inputs.total-shard }}) - ${{ (matrix.mongodb-version == '7.0' && 'Debian' && false) || 'Alpine (Official)' }}

steps:
- name: Collect Workflow Telemetry
Expand Down Expand Up @@ -198,7 +194,6 @@ jobs:
TRANSPORTER: ${{ inputs.transporter }}
COVERAGE_DIR: '/tmp/coverage'
COVERAGE_REPORTER: 'lcov'
DISABLE_DB_WATCHERS: ${{ inputs.db-watcher-disabled }}
run: |
DEBUG_LOG_LEVEL=${DEBUG_LOG_LEVEL:-0} docker compose -f docker-compose-ci.yml up -d

Expand Down Expand Up @@ -289,7 +284,7 @@ jobs:
if: inputs.type == 'ui' && always()
uses: actions/upload-artifact@v4
with:
name: playwright-test-trace-${{ inputs.release }}-${{ matrix.mongodb-version }}-${{ matrix.shard }}
name: playwright-test-trace-${{ inputs.release }}-${{ matrix.mongodb-version }}-${{ matrix.shard }}${{ inputs.db-watcher-disabled == 'true' && '-no-watcher' || '' }}
path: ./apps/meteor/tests/e2e/.playwright*
include-hidden-files: true

Expand Down Expand Up @@ -327,14 +322,14 @@ jobs:
if: inputs.type == 'api' && inputs.release == 'ee'
uses: actions/upload-artifact@v4
with:
name: e2e-api-ee-coverage-${{ matrix.mongodb-version }}-${{ matrix.shard }}
name: e2e-api-ee-coverage-${{ matrix.mongodb-version }}-${{ matrix.shard }}${{ inputs.db-watcher-disabled == 'true' && '-no-watcher' || '' }}
path: /tmp/coverage
include-hidden-files: true

- name: Store e2e-ee-coverage
if: inputs.type == 'ui' && inputs.release == 'ee'
uses: actions/upload-artifact@v4
with:
name: e2e-ee-coverage-${{ matrix.mongodb-version }}-${{ matrix.shard }}
name: e2e-ee-coverage-${{ matrix.mongodb-version }}-${{ matrix.shard }}${{ inputs.db-watcher-disabled == 'true' && '-no-watcher' || '' }}
path: ./apps/meteor/coverage*
include-hidden-files: true
46 changes: 6 additions & 40 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ jobs:
fi;

curl -H "Content-Type: application/json" -H "X-Update-Token: $UPDATE_TOKEN" -d \
"{\"nodeVersion\": \"${{ needs.release-versions.outputs.node-version }}\", \"denoVersion\": \"${{ needs.release-versions.outputs.deno-version }}\", \"compatibleMongoVersions\": [\"5.0\", \"6.0\", \"7.0\"], \"commit\": \"$GITHUB_SHA\", \"tag\": \"$RC_VERSION\", \"branch\": \"$GIT_BRANCH\", \"artifactName\": \"$ARTIFACT_NAME\", \"releaseType\": \"draft\", \"draftAs\": \"$RC_RELEASE\"}" \
"{\"nodeVersion\": \"${{ needs.release-versions.outputs.node-version }}\", \"denoVersion\": \"${{ needs.release-versions.outputs.deno-version }}\",\"compatibleMongoVersions\": [\"7.0\"], \"commit\": \"$GITHUB_SHA\", \"tag\": \"$RC_VERSION\", \"branch\": \"$GIT_BRANCH\", \"artifactName\": \"$ARTIFACT_NAME\", \"releaseType\": \"draft\", \"draftAs\": \"$RC_RELEASE\"}" \
https://releases.rocket.chat/update

packages-build:
Expand Down Expand Up @@ -320,7 +320,7 @@ jobs:
node-version: ${{ needs.release-versions.outputs.node-version }}
deno-version: ${{ needs.release-versions.outputs.deno-version }}
platform: ${{ matrix.platform }}
build-containers: ${{ matrix.platform == needs.release-versions.outputs.official-platform && 'authorization-service account-service ddp-streamer-service presence-service stream-hub-service queue-worker-service omnichannel-transcript-service' || '' }}
build-containers: ${{ matrix.platform == needs.release-versions.outputs.official-platform && 'authorization-service account-service ddp-streamer-service presence-service queue-worker-service omnichannel-transcript-service' || '' }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Make sure matrix bindings load
Expand Down Expand Up @@ -363,7 +363,7 @@ jobs:
node-version: ${{ needs.release-versions.outputs.node-version }}
deno-version: ${{ needs.release-versions.outputs.deno-version }}
platform: ${{ matrix.platform }}
build-containers: ${{ matrix.platform == needs.release-versions.outputs.official-platform && 'authorization-service account-service ddp-streamer-service presence-service stream-hub-service queue-worker-service omnichannel-transcript-service' || '' }}
build-containers: ${{ matrix.platform == needs.release-versions.outputs.official-platform && 'authorization-service account-service ddp-streamer-service presence-service queue-worker-service omnichannel-transcript-service' || '' }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Rename official Docker tag to GitHub Container Registry
Expand Down Expand Up @@ -466,7 +466,7 @@ jobs:
release: ee
transporter: 'nats://nats:4222'
enterprise-license: ${{ needs.release-versions.outputs.enterprise-license }}
mongodb-version: "['5.0']"
mongodb-version: "['7.0']"
node-version: ${{ needs.release-versions.outputs.node-version }}
deno-version: ${{ needs.release-versions.outputs.deno-version }}
lowercase-repo: ${{ needs.release-versions.outputs.lowercase-repo }}
Expand All @@ -481,35 +481,6 @@ jobs:
name: 🔨 Test UI (EE)
needs: [checks, build-gh-docker-coverage, release-versions]

uses: ./.github/workflows/ci-test-e2e.yml
with:
type: ui
release: ee
transporter: 'nats://nats:4222'
enterprise-license: ${{ needs.release-versions.outputs.enterprise-license }}
shard: '[1, 2, 3, 4, 5]'
total-shard: 5
mongodb-version: "['5.0']"
node-version: ${{ needs.release-versions.outputs.node-version }}
deno-version: ${{ needs.release-versions.outputs.deno-version }}
lowercase-repo: ${{ needs.release-versions.outputs.lowercase-repo }}
rc-dockerfile: ${{ needs.release-versions.outputs.rc-dockerfile }}
rc-docker-tag: ${{ needs.release-versions.outputs.rc-docker-tag }}
gh-docker-tag: ${{ needs.release-versions.outputs.gh-docker-tag }}
retries: ${{ (github.event_name == 'release' || github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master') && 2 || 0 }}
secrets:
CR_USER: ${{ secrets.CR_USER }}
CR_PAT: ${{ secrets.CR_PAT }}
QASE_API_TOKEN: ${{ secrets.QASE_API_TOKEN }}
REPORTER_ROCKETCHAT_API_KEY: ${{ secrets.REPORTER_ROCKETCHAT_API_KEY }}
REPORTER_ROCKETCHAT_URL: ${{ secrets.REPORTER_ROCKETCHAT_URL }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
REPORTER_JIRA_ROCKETCHAT_API_KEY: ${{ secrets.REPORTER_JIRA_ROCKETCHAT_API_KEY }}

test-ui-ee-watcher:
name: 🔨 Test UI (EE)
needs: [checks, build-gh-docker-coverage, release-versions]

uses: ./.github/workflows/ci-test-e2e.yml
with:
type: ui
Expand All @@ -526,7 +497,6 @@ jobs:
rc-docker-tag: ${{ needs.release-versions.outputs.rc-docker-tag }}
gh-docker-tag: ${{ needs.release-versions.outputs.gh-docker-tag }}
retries: ${{ (github.event_name == 'release' || github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master') && 2 || 0 }}
db-watcher-disabled: 'false'
secrets:
CR_USER: ${{ secrets.CR_USER }}
CR_PAT: ${{ secrets.CR_PAT }}
Expand All @@ -539,7 +509,7 @@ jobs:
tests-done:
name: ✅ Tests Done
runs-on: ubuntu-24.04
needs: [checks, test-unit, test-api, test-ui, test-api-ee, test-ui-ee, test-ui-ee-watcher]
needs: [checks, test-unit, test-api, test-ui, test-api-ee, test-ui-ee]
if: always()
steps:
- name: Test finish aggregation
Expand Down Expand Up @@ -568,10 +538,6 @@ jobs:
exit 1
fi

if [[ '${{ needs.test-ui-ee-watcher.result }}' != 'success' ]]; then
exit 1
fi

echo finished

deploy:
Expand Down Expand Up @@ -868,7 +834,7 @@ jobs:
fi;

curl -H "Content-Type: application/json" -H "X-Update-Token: $UPDATE_TOKEN" -d \
"{\"nodeVersion\": \"${{ needs.release-versions.outputs.node-version }}\", \"denoVersion\": \"${{ needs.release-versions.outputs.deno-version }}\", \"compatibleMongoVersions\": [\"5.0\", \"6.0\", \"7.0\"], \"commit\": \"$GITHUB_SHA\", \"tag\": \"$RC_VERSION\", \"branch\": \"$GIT_BRANCH\", \"artifactName\": \"$ARTIFACT_NAME\", \"releaseType\": \"$RC_RELEASE\"}" \
"{\"nodeVersion\": \"${{ needs.release-versions.outputs.node-version }}\", \"denoVersion\": \"${{ needs.release-versions.outputs.deno-version }}\", \"compatibleMongoVersions\": [\"7.0\"], \"commit\": \"$GITHUB_SHA\", \"tag\": \"$RC_VERSION\", \"branch\": \"$GIT_BRANCH\", \"artifactName\": \"$ARTIFACT_NAME\", \"releaseType\": \"$RC_RELEASE\"}" \
https://releases.rocket.chat/update

# Makes build fail if the release isn't there
Expand Down
25 changes: 0 additions & 25 deletions apps/meteor/app/api/server/v1/chat.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Message } from '@rocket.chat/core-services';
import type { IMessage, IThreadMainMessage } from '@rocket.chat/core-typings';
import { Messages, Users, Rooms, Subscriptions } from '@rocket.chat/models';
import {
Expand All @@ -20,7 +19,6 @@ import {
isChatFollowMessageProps,
isChatUnfollowMessageProps,
isChatGetMentionedMessagesProps,
isChatOTRProps,
isChatReactProps,
isChatGetDeletedMessagesProps,
isChatSyncThreadsListProps,
Expand All @@ -40,7 +38,6 @@ import { messageSearch } from '../../../../server/methods/messageSearch';
import { getMessageHistory } from '../../../../server/publications/messages';
import { roomAccessAttributes } from '../../../authorization/server';
import { canAccessRoomAsync, canAccessRoomIdAsync } from '../../../authorization/server/functions/canAccessRoom';
import { canSendMessageAsync } from '../../../authorization/server/functions/canSendMessage';
import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission';
import { deleteMessageValidatingPermission } from '../../../lib/server/functions/deleteMessage';
import { processWebhookMessage } from '../../../lib/server/functions/processWebhookMessage';
Expand Down Expand Up @@ -877,28 +874,6 @@ API.v1.addRoute(
},
);

API.v1.addRoute(
'chat.otr',
{ authRequired: true, validateParams: isChatOTRProps },
{
async post() {
const { roomId, type: otrType } = this.bodyParams;

const { username, type } = this.user;

if (!username) {
throw new Meteor.Error('error-invalid-user', 'Invalid user');
}

await canSendMessageAsync(roomId, { uid: this.userId, username, type });

await Message.saveSystemMessage(otrType, roomId, username, { _id: this.userId, username });

return API.v1.success();
},
},
);

API.v1.addRoute(
'chat.getURLPreview',
{ authRequired: true, validateParams: isChatGetURLPreviewProps },
Expand Down
7 changes: 1 addition & 6 deletions apps/meteor/app/lib/server/functions/sendMessage.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Apps } from '@rocket.chat/apps';
import { api, Message } from '@rocket.chat/core-services';
import { Message } from '@rocket.chat/core-services';
import type { IMessage, IRoom } from '@rocket.chat/core-typings';
import { Messages } from '@rocket.chat/models';
import { Match, check } from 'meteor/check';
Expand Down Expand Up @@ -225,11 +225,6 @@ export const sendMessage = async function (user: any, message: any, room: any, u
await validateMessage(message, room, user);
prepareMessageObject(message, room._id, user);

if (message.t === 'otr') {
void api.broadcast('otrMessage', { roomId: message.rid, message, user, room });
return message;
}

if (settings.get('Message_Read_Receipt_Enabled')) {
message.unread = true;
}
Expand Down
Loading
Loading