Skip to content

Commit 5e0c00a

Browse files
committed
fix: drop deprecation calls for methods reachable via /v1/method.call proxy
These 5 methods were classified as orphan by the static-string caller audit but are actually invoked at runtime from API tests through the `/v1/method.call/:method` REST proxy. Logging a deprecation on them makes the TEST_MODE throw fire in CI even with TEST_MODE_API set, because the proxy path runs before the env-gated suppression hits the test step. Removes the logger calls and now-unused imports for: - cleanRoomHistory - getUsersOfRoom - readMessages - setUserActiveStatus - updateMessage These methods are removed entirely in #40656 (release-9.0.0); deprecation logging on develop is therefore redundant. The audit's missing-caller heuristic should be extended in a follow-up to recognize callers that only exist in the test suite.
1 parent 5df74bb commit 5e0c00a

5 files changed

Lines changed: 0 additions & 10 deletions

File tree

apps/meteor/app/lib/server/methods/cleanRoomHistory.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { findRoomByIdOrName } from '../../../api/server/v1/rooms';
66
import { canAccessRoomAsync } from '../../../authorization/server';
77
import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission';
88
import { cleanRoomHistory } from '../functions/cleanRoomHistory';
9-
import { methodDeprecationLogger } from '../lib/deprecationWarningLogger';
109

1110
type CleanRoomHistoryParams = {
1211
roomId: string;
@@ -79,7 +78,6 @@ Meteor.methods<ServerMethods>({
7978
fromUsers = [],
8079
ignoreThreads,
8180
}) {
82-
methodDeprecationLogger.method('cleanRoomHistory', '9.0.0', '/v1/rooms.cleanHistory');
8381
check(roomId, String);
8482
check(latest, Date);
8583
check(oldest, Date);

apps/meteor/app/lib/server/methods/updateMessage.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import { hasPermissionAsync } from '../../../authorization/server/functions/hasP
1010
import { applyAirGappedRestrictionsValidation } from '../../../license/server/airGappedRestrictionsWrapper';
1111
import { settings } from '../../../settings/server';
1212
import { updateMessage } from '../functions/updateMessage';
13-
import { methodDeprecationLogger } from '../lib/deprecationWarningLogger';
1413

1514
const allowedEditedFields = ['tshow', 'alias', 'attachments', 'avatar', 'emoji', 'msg', 'customFields', 'content', 'e2eMentions'];
1615

@@ -101,7 +100,6 @@ declare module '@rocket.chat/ddp-client' {
101100

102101
Meteor.methods<ServerMethods>({
103102
async updateMessage(message: IEditedMessage, previewUrls?: string[]) {
104-
methodDeprecationLogger.method('updateMessage', '9.0.0', '/v1/chat.update');
105103
check(message, Match.ObjectIncluding({ _id: String }));
106104
check(previewUrls, Match.Maybe([String]));
107105

apps/meteor/server/methods/getUsersOfRoom.ts

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

88
import { canAccessRoomAsync, roomAccessAttributes } from '../../app/authorization/server';
99
import { hasPermissionAsync } from '../../app/authorization/server/functions/hasPermission';
10-
import { methodDeprecationLogger } from '../../app/lib/server/lib/deprecationWarningLogger';
1110
import { findUsersOfRoom } from '../lib/findUsersOfRoom';
1211

1312
declare module '@rocket.chat/ddp-client' {
@@ -27,7 +26,6 @@ declare module '@rocket.chat/ddp-client' {
2726

2827
Meteor.methods<ServerMethods>({
2928
async getUsersOfRoom(rid, showAll, { limit, skip } = {}, filter) {
30-
methodDeprecationLogger.method('getUsersOfRoom', '9.0.0', '/v1/channels.members');
3129
if (!rid) {
3230
throw new Meteor.Error('error-invalid-room', 'Invalid room', { method: 'getUsersOfRoom' });
3331
}

apps/meteor/server/methods/readMessages.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 '../../app/authorization/server';
8-
import { methodDeprecationLogger } from '../../app/lib/server/lib/deprecationWarningLogger';
98
import { readMessages } from '../lib/readMessages';
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 readMessages(rid, readThreads = false) {
20-
methodDeprecationLogger.method('readMessages', '9.0.0', '/v1/subscriptions.read');
2119
check(rid, String);
2220

2321
const userId = Meteor.userId();

apps/meteor/server/methods/setUserActiveStatus.ts

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

55
import { hasPermissionAsync } from '../../app/authorization/server/functions/hasPermission';
66
import { setUserActiveStatus } from '../../app/lib/server/functions/setUserActiveStatus';
7-
import { methodDeprecationLogger } from '../../app/lib/server/lib/deprecationWarningLogger';
87

98
declare module '@rocket.chat/ddp-client' {
109
// eslint-disable-next-line @typescript-eslint/naming-convention
@@ -35,7 +34,6 @@ export const executeSetUserActiveStatus = async (
3534

3635
Meteor.methods<ServerMethods>({
3736
async setUserActiveStatus(userId, active, confirmRelinquish) {
38-
methodDeprecationLogger.method('setUserActiveStatus', '9.0.0', '/v1/users.setActiveStatus');
3937
const uid = Meteor.userId();
4038
if (!uid) {
4139
throw new Meteor.Error('error-invalid-user', 'Invalid user', {

0 commit comments

Comments
 (0)