Skip to content

Commit 545ca90

Browse files
committed
chore: drop deprecation calls on USED methods to unblock test suites
The deprecation logger throws in TEST_MODE (apps/meteor/app/lib/server/lib/deprecationWarningLogger.ts:118), so a deprecation log on a method that's still invoked by integration or unit tests turns those tests into failures with messages like: Error: The method "addUsersToRoom" is deprecated and will be removed on version 9.0.0 That's the intended dev-loop guard rail, but it means this PR can only carry deprecation calls on methods with **no callers**. Removes the 83 logger calls (and their now-unused imports) that targeted methods listed in audit.used. They will be revisited as part of the caller-migration PR #40659 — once each callsite moves to the matching REST endpoint, the DDP method can either get a deprecation log here or be removed outright in #40656. What remains in this PR: 71 deprecation calls, all on orphan methods without a REST replacement.
1 parent e7687f5 commit 545ca90

83 files changed

Lines changed: 246 additions & 417 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/meteor/app/2fa/server/methods/disable.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import type { ServerMethods } from '@rocket.chat/ddp-client';
22
import { Users } from '@rocket.chat/models';
33
import { Meteor } from 'meteor/meteor';
44

5-
import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger';
65
import { notifyOnUserChange } from '../../../lib/server/lib/notifyListener';
76
import { TOTP } from '../lib/totp';
87

@@ -15,7 +14,6 @@ declare module '@rocket.chat/ddp-client' {
1514

1615
Meteor.methods<ServerMethods>({
1716
async '2fa:disable'(code) {
18-
methodDeprecationLogger.method('2fa:disable', '9.0.0', []);
1917
const userId = Meteor.userId();
2018
if (!userId) {
2119
throw new Meteor.Error('not-authorized');

apps/meteor/app/2fa/server/methods/enable.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import type { ServerMethods } from '@rocket.chat/ddp-client';
22
import { Users } from '@rocket.chat/models';
33
import { Meteor } from 'meteor/meteor';
44

5-
import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger';
65
import { TOTP } from '../lib/totp';
76

87
declare module '@rocket.chat/ddp-client' {
@@ -14,7 +13,6 @@ declare module '@rocket.chat/ddp-client' {
1413

1514
Meteor.methods<ServerMethods>({
1615
async '2fa:enable'() {
17-
methodDeprecationLogger.method('2fa:enable', '9.0.0', []);
1816
const userId = Meteor.userId();
1917
if (!userId) {
2018
throw new Meteor.Error('not-authorized');

apps/meteor/app/autotranslate/server/methods/getSupportedLanguages.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import type { ServerMethods } from '@rocket.chat/ddp-client';
33
import { DDPRateLimiter } from 'meteor/ddp-rate-limiter';
44
import { Meteor } from 'meteor/meteor';
55

6-
import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger';
76
import { getSupportedLanguages } from '../functions/getSupportedLanguages';
87

98
declare module '@rocket.chat/ddp-client' {
@@ -15,7 +14,6 @@ declare module '@rocket.chat/ddp-client' {
1514

1615
Meteor.methods<ServerMethods>({
1716
async 'autoTranslate.getSupportedLanguages'(targetLanguage) {
18-
methodDeprecationLogger.method('autoTranslate.getSupportedLanguages', '9.0.0', '/v1/autotranslate.getSupportedLanguages');
1917
const userId = Meteor.userId();
2018

2119
if (!userId) {

apps/meteor/app/autotranslate/server/methods/translateMessage.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { check } from 'meteor/check';
55
import { Meteor } from 'meteor/meteor';
66

77
import { canAccessRoomAsync } from '../../../authorization/server';
8-
import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger';
98
import { translateMessage } from '../functions/translateMessage';
109

1110
declare module '@rocket.chat/ddp-client' {
@@ -17,7 +16,6 @@ declare module '@rocket.chat/ddp-client' {
1716

1817
Meteor.methods<ServerMethods>({
1918
async 'autoTranslate.translateMessage'(message, targetLanguage) {
20-
methodDeprecationLogger.method('autoTranslate.translateMessage', '9.0.0', '/v1/autotranslate.translateMessage');
2119
const userId = Meteor.userId();
2220
if (!userId) {
2321
throw new Meteor.Error('error-invalid-user', 'Invalid user', {

apps/meteor/app/channel-settings/server/methods/saveRoomSettings.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import { roomCoordinator } from '../../../../server/lib/rooms/roomCoordinator';
1111
import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission';
1212
import { isABACManagedRoom } from '../../../authorization/server/lib/isABACManagedRoom';
1313
import { setRoomAvatar } from '../../../lib/server/functions/setRoomAvatar';
14-
import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger';
1514
import { notifyOnRoomChangedById } from '../../../lib/server/lib/notifyListener';
1615
import { settings } from '../../../settings/server';
1716
import { saveReactWhenReadOnly } from '../functions/saveReactWhenReadOnly';
@@ -548,7 +547,6 @@ export async function saveRoomSettings(
548547

549548
Meteor.methods<ServerMethods>({
550549
saveRoomSettings: (...args) => {
551-
methodDeprecationLogger.method('saveRoomSettings', '9.0.0', '/v1/rooms.saveRoomSettings');
552550
const userId = Meteor.userId();
553551
if (!userId) {
554552
throw new Meteor.Error('error-invalid-user', 'Invalid user', {

apps/meteor/app/cloud/server/methods.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ Meteor.methods<ServerMethods>({
9797
return startRegisterWorkspace();
9898
},
9999
async 'cloud:syncWorkspace'() {
100-
methodDeprecationLogger.method('cloud:syncWorkspace', '9.0.0', '/v1/cloud.syncWorkspace');
101100
const uid = Meteor.userId();
102101

103102
if (!uid) {

apps/meteor/app/discussion/server/methods/createDiscussion.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import { attachMessage } from '../../../lib/server/functions/attachMessage';
1515
import { createRoom } from '../../../lib/server/functions/createRoom';
1616
import { sendMessage } from '../../../lib/server/functions/sendMessage';
1717
import { afterSaveMessageAsync } from '../../../lib/server/lib/afterSaveMessage';
18-
import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger';
1918
import { settings } from '../../../settings/server';
2019

2120
const getParentRoom = async (rid: IRoom['_id']) => {
@@ -251,7 +250,6 @@ Meteor.methods<ServerMethods>({
251250
* @deprecated Scheduled for removal in 9.0.0. No caller found in this repository — kept for external DDP clients only.
252251
*/
253252
async createDiscussion({ prid, pmid, t_name: discussionName, reply, users, encrypted }: CreateDiscussionProperties) {
254-
methodDeprecationLogger.method('createDiscussion', '9.0.0', '/v1/rooms.createDiscussion');
255253
check(prid, Match.Maybe(String));
256254
check(pmid, Match.Maybe(String));
257255
check(reply, Match.Maybe(String));

apps/meteor/app/e2e/server/methods/fetchMyKeys.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ import type { ServerMethods } from '@rocket.chat/ddp-client';
22
import { Users } from '@rocket.chat/models';
33
import { Meteor } from 'meteor/meteor';
44

5-
import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger';
6-
75
declare module '@rocket.chat/ddp-client' {
86
// eslint-disable-next-line @typescript-eslint/naming-convention
97
interface ServerMethods {
@@ -16,7 +14,6 @@ Meteor.methods<ServerMethods>({
1614
* @deprecated Scheduled for removal in 9.0.0. No caller found in this repository — kept for external DDP clients only.
1715
*/
1816
async 'e2e.fetchMyKeys'() {
19-
methodDeprecationLogger.method('e2e.fetchMyKeys', '9.0.0', '/v1/e2e.fetchMyKeys');
2017
const userId = Meteor.userId();
2118
if (!userId) {
2219
throw new Meteor.Error('error-invalid-user', 'Invalid user', { method: 'e2e.fetchMyKeys' });

apps/meteor/app/e2e/server/methods/getUsersOfRoomWithoutKey.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { check } from 'meteor/check';
55
import { Meteor } from 'meteor/meteor';
66

77
import { canAccessRoomIdAsync } from '../../../authorization/server/functions/canAccessRoom';
8-
import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger';
98

109
declare module '@rocket.chat/ddp-client' {
1110
// eslint-disable-next-line @typescript-eslint/naming-convention
@@ -37,7 +36,6 @@ export const getUsersOfRoomWithoutKeyMethod = async (
3736

3837
Meteor.methods<ServerMethods>({
3938
async 'e2e.getUsersOfRoomWithoutKey'(rid) {
40-
methodDeprecationLogger.method('e2e.getUsersOfRoomWithoutKey', '9.0.0', '/v1/e2e.getUsersOfRoomWithoutKey');
4139
check(rid, String);
4240

4341
const userId = Meteor.userId();

apps/meteor/app/e2e/server/methods/setRoomKeyID.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { check } from 'meteor/check';
55
import { Meteor } from 'meteor/meteor';
66

77
import { canAccessRoomIdAsync } from '../../../authorization/server/functions/canAccessRoom';
8-
import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger';
98
import { notifyOnRoomChangedById } from '../../../lib/server/lib/notifyListener';
109

1110
declare module '@rocket.chat/ddp-client' {
@@ -39,7 +38,6 @@ export const setRoomKeyIDMethod = async (userId: string, rid: IRoom['_id'], keyI
3938

4039
Meteor.methods<ServerMethods>({
4140
async 'e2e.setRoomKeyID'(rid, keyID) {
42-
methodDeprecationLogger.method('e2e.setRoomKeyID', '9.0.0', '/v1/e2e.setRoomKeyID');
4341
check(rid, String);
4442
check(keyID, String);
4543

0 commit comments

Comments
 (0)