{"record":{"id":"b9a9c65510ea6b8c","repo":"RocketChat/Rocket.Chat","slug":"error-app-prevented-updating","errorCode":"error-app-prevented-updating","errorMessage":"A Rocket.Chat App prevented the message updating.","messagePattern":"A Rocket\\.Chat App prevented the message updating\\.","errorType":"error_code","errorClass":"Meteor.Error","httpStatus":null,"severity":"error","filePath":"apps/meteor/server/lib/messages/updateMessage.ts","lineNumber":34,"sourceCode":"\t}: (AtLeast<IMessage, '_id' | 'rid' | 'msg' | 'customFields'> | AtLeast<IMessage, '_id' | 'rid' | 'content'>) & {\n\t\tparseUrls?: boolean;\n\t},\n\tuser: IUser,\n\toriginalMsg?: IMessage,\n\tpreviewUrls?: string[],\n): Promise<void> {\n\tconst originalMessage = originalMsg || (await Messages.findOneById(message._id));\n\tif (!originalMessage) {\n\t\tthrow new Error('Invalid message ID.');\n\t}\n\n\tlet messageData: IMessage = Object.assign({}, originalMessage, message);\n\n\t// For the Rocket.Chat Apps :)\n\tif (message && Apps.self && Apps.isLoaded()) {\n\t\tconst prevent = await Apps.self?.triggerEvent(AppEvents.IPreMessageUpdatedPrevent, messageData);\n\t\tif (prevent) {\n\t\t\tthrow new Meteor.Error('error-app-prevented-updating', 'A Rocket.Chat App prevented the message updating.');\n\t\t}\n\n\t\tlet result = await Apps.self?.triggerEvent(AppEvents.IPreMessageUpdatedExtend, messageData);\n\t\tresult = await Apps.self?.triggerEvent(AppEvents.IPreMessageUpdatedModify, result);\n\n\t\tif (typeof result === 'object') {\n\t\t\tObject.assign(messageData, result);\n\t\t}\n\t}\n\n\t// If we keep history of edits, insert a new message to store history information\n\tif (settings.get('Message_KeepHistory')) {\n\t\tawait Messages.cloneAndSaveAsHistoryById(messageData._id, user as Required<Pick<IUser, '_id' | 'username' | 'name'>>);\n\t}\n\n\tObject.assign(messageData, {\n\t\teditedAt: new Date(),\n\t\teditedBy: {","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/server/lib/messages/updateMessage.ts#L16-L52","documentation":"Error \"A Rocket.Chat App prevented the message updating.\" thrown in RocketChat/Rocket.Chat.","triggerScenarios":"Thrown at apps/meteor/server/lib/messages/updateMessage.ts:34 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check which installed Rocket.Chat App returned true from the IPreMessageUpdatedPrevent event and adjust or disable that app's handler.","Review the app logs to find why the app prevented the message update."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0","analyzedAt":"2026-08-18T15:26:39.429Z","contentChangedAt":"2026-08-18T15:26:39.429Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}