{"record":{"id":"7a717747dd338aea","repo":"larksuite/cli","slug":"total-attachment-size-1f-mb-exceeds-the-25-mb-li","errorCode":null,"errorMessage":"total attachment size %.1f MB exceeds the 25 MB limit","messagePattern":"total attachment size %\\.1f MB exceeds the 25 MB limit","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"shortcuts/mail/draft/limits.go","lineNumber":61,"sourceCode":"\t\t\tcontinue\n\t\t}\n\t\texistingCount++\n\t\texistingBytes += int64(len(p.Body))\n\t}\n\n\ttotalCount := existingCount\n\ttotalBytes := existingBytes + newFileSize\n\tif replacedPart != nil {\n\t\ttotalBytes -= int64(len(replacedPart.Body))\n\t} else {\n\t\ttotalCount++\n\t}\n\n\tif totalCount > maxAttachmentCount {\n\t\treturn fmt.Errorf(\"attachment count %d exceeds the limit of %d\", totalCount, maxAttachmentCount)\n\t}\n\tif totalBytes > maxAttachmentBytes {\n\t\treturn fmt.Errorf(\"total attachment size %.1f MB exceeds the 25 MB limit\",\n\t\t\tfloat64(totalBytes)/1024/1024)\n\t}\n\treturn nil\n}\n","sourceCodeStart":43,"sourceCodeEnd":66,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/shortcuts/mail/draft/limits.go#L43-L66","documentation":"Attachment-limit guard in checkSnapshotAttachmentLimit: total attachment bytes (existing plus new, minus replaced part) exceed the 25 MB mail draft cap.","triggerScenarios":"Thrown at shortcuts/mail/draft/limits.go:61 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use the large-attachment upload path instead of inline MIME parts, or attach less data"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7fd6ef3c07182257ce776cdc5a614e122d5bd4b3","analyzedAt":"2026-09-04T21:17:44.649Z","contentChangedAt":"2026-09-04T21:17:44.649Z","schemaVersion":2},"datasetVersion":"2026-09-12T02:17:10.037Z"}