{"record":{"id":"a89a9ca359e96741","repo":"jitsi/jitsi-meet","slug":"setting-password-failed","errorCode":null,"errorMessage":"setting password failed","messagePattern":"setting password failed","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"react/features/room-lock/middleware.ts","lineNumber":138,"sourceCode":" * @param {Action} action - The redux action {@code SET_PASSWORD_ERROR} which\n * has the error type that should be handled.\n * @private\n * @returns {*}\n */\nfunction _setPasswordFailed(store: IStore, next: Function, action: AnyAction) {\n    if (typeof APP !== 'undefined') {\n        // TODO Remove this logic when displaying of error messages on web is\n        // handled through react/redux.\n        const { error } = action;\n        let descriptionKey;\n        let titleKey;\n\n        if (error === JitsiConferenceErrors.PASSWORD_NOT_SUPPORTED) {\n            logger.warn('room passwords not supported');\n            descriptionKey = 'dialog.passwordNotSupported';\n            titleKey = 'dialog.passwordNotSupportedTitle';\n        } else {\n            logger.warn('setting password failed', error);\n            descriptionKey = 'dialog.lockMessage';\n            titleKey = 'dialog.lockTitle';\n        }\n        APP.store.dispatch(showErrorNotification({\n            descriptionKey,\n            titleKey\n        }));\n    }\n\n    return next(action);\n}\n","sourceCodeStart":120,"sourceCodeEnd":150,"githubUrl":"https://github.com/jitsi/jitsi-meet/blob/98de6219cc7ddbe07ace9fde045aff90a242ba01/react/features/room-lock/middleware.ts#L120-L150","documentation":"The generic branch of _setPasswordFailed: any setPassword failure other than PASSWORD_NOT_SUPPORTED logs 'setting password failed' with the underlying error and shows the generic 'dialog.lockMessage' dialog. Typical underlying errors are AUTHENTICATION_REQUIRED (only moderators can lock), the conference being disconnected, or a server-side XMPP error. The logged 'error' argument is the JitsiConferenceError instance that carries the real cause.","triggerScenarios":"A non-moderator participant calls conference.lock(password); calling lock after the conference ended or during reconnection; prosody rejecting the IQ with a conflict/forbidden error; attempting to change the password while another lock operation is in flight.","commonSituations":"Participant role not yet promoted to moderator (moderation delayed after JOIN_RESPONSE), flaky XMPP connection causing lock requests during reconnection, races between two moderators changing the password simultaneously.","solutions":["Ensure the lock request is made by a moderator: check participant.role === 'moderator' (or isModerator(state)) before showing/enabling the password UI; wait for role promotion after joining.","Verify the conference is in the joined state (conference.getConnectionState() or redux 'joined' status) before locking.","Retry after reconnection if the failure coincided with a dropped XMPP connection; inspect the full error object logged for the specific JitsiConferenceError reason."],"exampleFix":"// before\nconference.lock(newPassword);\n\n// after\nconst state = store.getState();\nif (isModerator(state) && getConferenceState(state).conference) {\n    conference.lock(newPassword);\n} else {\n    dispatch(showWarningNotification({ titleKey: 'dialog.notModerator' }));\n}","handlingStrategy":"try-catch","validationCode":"const canLock = (state: IReduxState) => isModerator(state) && Boolean(getConference(state));\nif (canLock(state)) { dispatch(setPassword(conference, undefined, pwd)); }","typeGuard":"null","tryCatchPattern":"conference.lock(pwd).catch((err: JitsiConferenceError) => {\n    if (err === JitsiConferenceErrors.AUTHENTICATION_REQUIRED) {\n        showError('You must be a moderator to lock the room');\n    } else {\n        showError('Setting password failed, please retry');\n    }\n});","preventionTips":["Only allow moderators to open the password dialog.","Wait for role promotion to moderator before enabling lock controls.","Avoid lock calls during reconnection; retry once reconnected.","Inspect the full JitsiConferenceError in logs to distinguish auth vs server errors."],"tags":["room-lock","password","moderator","xmpp"],"backgroundTag":"operation-permission-denied","analyzedSha":"98de6219cc7ddbe07ace9fde045aff90a242ba01","analyzedAt":"2026-08-28T15:15:59.482Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}