{"record":{"id":"d0701e6ebf7107d2","repo":"RocketChat/Rocket.Chat","slug":"error-status-not-allowed-d0701e","errorCode":"error-status-not-allowed","errorMessage":"Invisible status is disabled","messagePattern":"Invisible status is disabled","errorType":"exception","errorClass":"Meteor.Error","httpStatus":null,"severity":"error","filePath":"apps/meteor/server/meteor-methods/users/setUserStatus.ts","lineNumber":30,"sourceCode":"\t\tsetUserStatus(statusType: IUser['status'], statusText: IUser['statusText']): void;\n\t}\n}\n\nexport const setUserStatusMethod = async (\n\tuser: Pick<IUser, '_id' | 'username' | 'name' | 'status' | 'statusDefault' | 'roles' | 'statusText'>,\n\tstatusType: IUser['status'],\n\tstatusText: IUser['statusText'],\n): Promise<void> => {\n\tif (statusText != null && !settings.get('Accounts_AllowUserStatusMessageChange')) {\n\t\tthrow new Meteor.Error('error-not-allowed', 'Not allowed', {\n\t\t\tmethod: 'setUserStatus',\n\t\t});\n\t}\n\n\tconst effectiveStatus = statusType || user.statusDefault || UserStatus.ONLINE;\n\n\tif (effectiveStatus === UserStatus.OFFLINE && !settings.get('Accounts_AllowInvisibleStatusOption')) {\n\t\tthrow new Meteor.Error('error-status-not-allowed', 'Invisible status is disabled', {\n\t\t\tmethod: 'setUserStatus',\n\t\t});\n\t}\n\n\tawait Presence.setStatus(user._id, effectiveStatus, statusText);\n};\n\nMeteor.methods<ServerMethods>({\n\tsetUserStatus: async (statusType, statusText) => {\n\t\tconst user = (await Meteor.userAsync()) as IUser;\n\t\tif (!user) {\n\t\t\tthrow new Meteor.Error('error-invalid-user', 'Invalid user', { method: 'setUserStatus' });\n\t\t}\n\n\t\tawait setUserStatusMethod(user, statusType, statusText);\n\t},\n});\n","sourceCodeStart":12,"sourceCodeEnd":48,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/server/meteor-methods/users/setUserStatus.ts#L12-L48","documentation":"setUserStatusMethod blocks the 'invisible' status: it computes effectiveStatus = statusType || user.statusDefault || online, and throws when it resolves to UserStatus.OFFLINE while Accounts_AllowInvisibleStatusOption is false. Note the check also fires for users whose saved statusDefault is offline even when they submit without an explicit type.","triggerScenarios":"Meteor.call('setUserStatus', 'offline', ...) or saveUserProfile with statusType: 'offline' when Accounts_AllowInvisibleStatusOption is disabled; also a user with statusDefault='offline' sending any update without an explicit statusType.","commonSituations":"Admins hiding invisible mode by policy; clients with a stale public-settings cache still offering the option; statusDefault persisted from a period when the option was allowed.","solutions":["Read Accounts_AllowInvisibleStatusOption from public settings and only offer/submit 'offline' when true","Enable the setting if invisible status should be available","Catch error-status-not-allowed and reset the status picker to a permitted value"],"exampleFix":"// before\nMeteor.call('setUserStatus', 'offline', statusText);\n\n// after\nconst allowInvisible = settings.get('Accounts_AllowInvisibleStatusOption');\nif (nextStatus !== 'offline' || allowInvisible) {\n  Meteor.call('setUserStatus', nextStatus, statusText);\n}","handlingStrategy":"validation","validationCode":"const allowInvisible = publicSettings['Accounts_AllowInvisibleStatusOption'] === true;\nconst effective = statusType || user.statusDefault || 'online';\nif (effective === 'offline' && !allowInvisible) {\n  showNotice('Invisible status is disabled');\n  return;\n}","typeGuard":null,"tryCatchPattern":"catch (err) {\n  if (err instanceof Meteor.Error && err.error === 'error-status-not-allowed') {\n    resetStatusPickerToValid(); // e.g. 'online'\n  }\n}","preventionTips":["Filter the 'offline/invisible' option from the picker when Accounts_AllowInvisibleStatusOption is false","Remember statusDefault is consulted server-side - users with a persisted offline default can trip this without choosing offline","Refresh public settings after admin changes instead of caching them for the whole session"],"tags":["meteor","presence","settings","status"],"backgroundTag":"feature-disabled-by-setting","analyzedSha":"b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0","analyzedAt":"2026-08-18T15:26:39.429Z","contentChangedAt":"2026-08-18T15:26:39.429Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}