{"record":{"id":"5ce5a85a378289fe","repo":"RocketChat/Rocket.Chat","slug":"error-mac-limit-reached-5ce5a8","errorCode":"error-mac-limit-reached","errorMessage":"error-mac-limit-reached","messagePattern":"error-mac-limit-reached","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/meteor/server/lib/omnichannel/sendTranscript.ts","lineNumber":244,"sourceCode":"}: {\n\trid: string;\n\temail: string;\n\tsubject: string;\n\tuser: AtLeast<IUser, '_id' | 'username' | 'utcOffset' | 'name'>;\n}) {\n\t// `v` is required by the MAC-limit check below\n\tconst room = await LivechatRooms.findOneById(rid, { projection: { _id: 1, open: 1, transcriptRequest: 1, v: 1 } });\n\n\tif (!room?.open) {\n\t\tthrow new Meteor.Error('error-invalid-room', 'Invalid room');\n\t}\n\n\tif (room.transcriptRequest) {\n\t\tthrow new Meteor.Error('error-transcript-already-requested', 'Transcript already requested');\n\t}\n\n\tif (!(await Omnichannel.isWithinMACLimit(room))) {\n\t\tthrow new Error('error-mac-limit-reached');\n\t}\n\n\tconst { _id, username, name, utcOffset } = user;\n\tconst transcriptRequest = {\n\t\trequestedAt: new Date(),\n\t\trequestedBy: {\n\t\t\t_id,\n\t\t\tusername,\n\t\t\tname,\n\t\t\tutcOffset,\n\t\t},\n\t\temail,\n\t\tsubject,\n\t};\n\n\tawait LivechatRooms.setEmailTranscriptRequestedByRoomId(rid, transcriptRequest);\n\treturn true;\n}","sourceCodeStart":226,"sourceCodeEnd":262,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/2a7de457074cbb4d4373fbd9a4e5bea292c9c764/apps/meteor/server/lib/omnichannel/sendTranscript.ts#L226-L262","documentation":"requestTranscript runs Omnichannel.isWithinMACLimit(room) before queueing the email; when the room's contact would push the workspace past its Monthly Active Contacts allowance (an enterprise-licensed metric), the check fails and it throws Error('error-mac-limit-reached'). The same guard exists in other omnichannel entry points (e.g. takeInquiry), so any of them can surface this code.","triggerScenarios":"Requesting a transcript for a room whose visitor/contact is new this month while the workspace already reached its MAC limit for the current billing cycle.","commonSituations":"Workspaces on an Omnichannel license tier whose monthly active contacts cap was consumed (traffic spike, bot/campaign generating many unique visitors), or trial licenses expiring with a reduced cap.","solutions":["Check the MAC usage in Administration > Omnichannel (contacts report) for the current period","Raise the limit: upgrade the license or contact sales to increase the MAC allowance","Wait for the monthly window to reset if the spike is transient","Audit what counts as an active contact — recurring visitors reuse the same contact and do not add to the count"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await requestTranscript({ rid, email, subject, user });\n} catch (err) {\n  if (err instanceof Error && err.message === 'error-mac-limit-reached') {\n    // licensing limit: surface 'contact limit reached' to admins, do not retry this month\n  } else {\n    throw err;\n  }\n}","preventionTips":["Monitor MAC usage versus license allowance throughout the month and alert before the cap","Size the license tier for peak months (campaigns/seasonal traffic)","Remember the same code guards other omnichannel entry points — fix the license, not one call site"],"tags":["omnichannel","transcript","license","mac-limit","enterprise"],"backgroundTag":"license-limit-reached","analyzedSha":"2a7de457074cbb4d4373fbd9a4e5bea292c9c764","analyzedAt":"2026-08-18T15:26:39.429Z","contentChangedAt":"2026-08-18T15:26:39.429Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}