{"record":{"id":"e6b314f1f3e18e94","repo":"RocketChat/Rocket.Chat","slug":"room-is-archived","errorCode":null,"errorMessage":"room_is_archived","messagePattern":"room_is_archived","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"apps/meteor/server/lib/authorization/canSendMessage.ts","lineNumber":27,"sourceCode":"const subscriptionOptions = {\n\tprojection: {\n\t\tblocked: 1,\n\t\tblocker: 1,\n\t},\n};\n\n// TODO: remove option uid and username and type\nexport async function validateRoomMessagePermissionsAsync(\n\troom: IRoom | null,\n\targs: { uid: IUser['_id']; username: IUser['username']; type: IUser['type'] } | IUser,\n\textraData?: Record<string, any>,\n): Promise<void> {\n\tif (!room) {\n\t\tthrow new Error('error-invalid-room');\n\t}\n\n\tif (room.archived) {\n\t\tthrow new Error('room_is_archived');\n\t}\n\tif (args.type !== 'app' && !(await canAccessRoomAsync(room, 'uid' in args ? { _id: args.uid } : args, extraData))) {\n\t\tthrow new Error('error-not-allowed');\n\t}\n\n\tif (\n\t\tawait roomCoordinator.getRoomDirectives(room.t).allowMemberAction(room, RoomMemberActions.BLOCK, 'uid' in args ? args.uid : args._id)\n\t) {\n\t\tconst subscription = await Subscriptions.findOneByRoomIdAndUserId(room._id, 'uid' in args ? args.uid : args._id, subscriptionOptions);\n\t\tif (subscription && (subscription.blocked || subscription.blocker)) {\n\t\t\tthrow new Error('room_is_blocked');\n\t\t}\n\t}\n\n\tif (room.ro === true && !(await hasPermissionAsync('uid' in args ? args.uid : args._id, 'post-readonly', room._id))) {\n\t\t// Unless the user was manually unmuted\n\t\tif (args.username && !(room.unmuted || []).includes(args.username)) {\n\t\t\tthrow new Error(\"You can't send messages because the room is readonly.\");","sourceCodeStart":9,"sourceCodeEnd":45,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/server/lib/authorization/canSendMessage.ts#L9-L45","documentation":"validateRoomMessagePermissionsAsync throws room_is_archived (plain Error) when room.archived is true — and it does so before any access or permission checks. Archived channels are frozen: nobody can send messages, regardless of role or permission.","triggerScenarios":"sendMessage / chat.postMessage / UI send targeting a channel that was archived by its owner or an admin, including webhooks and integrations still pointed at the archived channel.","commonSituations":"Webhooks keep posting to a channel archived at project end; clients hold a stale cached room list and let users type into archived channels; users do not notice the archived banner.","solutions":["Unarchive the channel (Administration -> Rooms, or owner actions) if posting should resume","Retire or redirect integrations/webhooks that target archived channels","Handle room_is_archived in clients by switching the room to a read-only 'archived' state instead of retrying"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (room.archived) {\n  // mark the channel as archived in the client and stop; do not call send\n}","typeGuard":"const isArchivedRoom = (room: { archived?: boolean }): boolean => room.archived === true;","tryCatchPattern":"try {\n  await sendMessage(...);\n} catch (e) {\n  if (e instanceof Error && e.message === 'room_is_archived') {\n    // permanent until unarchived: show archived state, disable composer\n  }\n  throw e;\n}","preventionTips":["Reflect room.archived in the client UI (disable composer) as soon as the room is loaded","Unsubscribe/repoint webhooks when archiving channels","Include archived channels in integration lifecycle checks"],"tags":["authorization","rooms","archived","messages"],"backgroundTag":"room-archived","analyzedSha":"b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0","analyzedAt":"2026-08-18T15:26:39.429Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}