Skip to content

Commit 743d248

Browse files
sampaiodiegoggazzo
andauthored
chore: update version validation checks (#38149)
Co-authored-by: Guilherme Gazzo <guilherme@gazzo.xyz>
1 parent 9e2e148 commit 743d248

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

apps/meteor/app/api/server/ApiClass.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ const logger = new Logger('API');
5757
// We have some breaking changes planned to the API.
5858
// To avoid conflicts or missing something during the period we are adopting a 'feature flag approach'
5959
// TODO: MAJOR check if this is still needed
60-
const applyBreakingChanges = shouldBreakInVersion('8.0.0');
60+
const applyBreakingChanges = shouldBreakInVersion('9.0.0');
6161
type MinimalRoute = {
6262
method: 'GET' | 'POST' | 'PUT' | 'DELETE';
6363
path: string;

apps/meteor/app/lib/server/functions/saveUser/saveUser.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -235,16 +235,15 @@ const _saveUser = (session?: ClientSession) =>
235235
return true;
236236
};
237237

238-
const isBroken = shouldBreakInVersion('8.0.0');
238+
const isBroken = shouldBreakInVersion('9.0.0');
239239
export const saveUser = (() => {
240-
if (isBroken) {
241-
throw new Error('DEBUG_DISABLE_USER_AUDIT flag is deprecated and should be removed');
242-
}
243-
244240
if (!process.env.DEBUG_DISABLE_USER_AUDIT) {
245241
return wrapInSessionTransaction(_saveUser);
246242
}
247243

244+
if (isBroken) {
245+
throw new Error('DEBUG_DISABLE_USER_AUDIT flag is deprecated and should be removed');
246+
}
248247
const saveUserNoSession = _saveUser();
249248
return function saveUser(userId: IUser['_id'], userData: SaveUserData, _options?: any) {
250249
return saveUserNoSession(userId, userData);
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import semver from 'semver';
22

3+
import type { DeprecationLoggerNextPlannedVersion } from '../../app/lib/server/lib/deprecationWarningLogger';
34
import { Info } from '../../app/utils/rocketchat.info';
45

5-
export const shouldBreakInVersion = (version: string) => semver.gte(Info.version, version);
6+
export const shouldBreakInVersion = (version: DeprecationLoggerNextPlannedVersion) => semver.gte(Info.version, version);

0 commit comments

Comments
 (0)