File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed
lib/server/functions/saveUser Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff 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' ) ;
6161type MinimalRoute = {
6262 method : 'GET' | 'POST' | 'PUT' | 'DELETE' ;
6363 path : string ;
Original file line number Diff line number Diff 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' ) ;
239239export 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 ) ;
Original file line number Diff line number Diff line change 11import semver from 'semver' ;
22
3+ import type { DeprecationLoggerNextPlannedVersion } from '../../app/lib/server/lib/deprecationWarningLogger' ;
34import { 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 ) ;
You can’t perform that action at this time.
0 commit comments