{"record":{"id":"f211e7f33676d9dc","repo":"gitroomhq/postiz-app","slug":"validation-name-the-maximum-characters-is-va","errorCode":null,"errorMessage":"${validation.name}: The maximum characters is ${validation.maximumCharacters}","messagePattern":"(.+?): The maximum characters is (.+?)","errorType":"validation","errorClass":"BadRequestException","httpStatus":400,"severity":"error","filePath":"libraries/nestjs-libraries/src/database/prisma/posts/posts.service.ts","lineNumber":1074,"sourceCode":"    }\n\n    if (root.state !== 'DRAFT') {\n      if (!validation.valid) {\n        throw new BadRequestException(\n          `${validation.name}: ${\n            validation.settingsError || 'Please fix your settings'\n          }`\n        );\n      }\n\n      if (validation.errors !== true) {\n        throw new BadRequestException(\n          `${validation.name}: ${validation.errors}`\n        );\n      }\n\n      if (validation.tooLong) {\n        throw new BadRequestException(\n          `${validation.name}: The maximum characters is ${validation.maximumCharacters}`\n        );\n      }\n    }\n\n    const date = dayjs.utc(root.publishDate).format('YYYY-MM-DDTHH:mm:ss');\n\n    const [output] = await this.createPost(\n      orgId,\n      {\n        date,\n        // Settings-only update: keep the current state and leave the running\n        // publish workflow alone.\n        type: 'update',\n        shortLink: false,\n        tags: ((root as any).tags || []).map((t: any) => ({\n          value: t.tag.name,\n          label: t.tag.name,","sourceCodeStart":1056,"sourceCodeEnd":1092,"githubUrl":"https://github.com/gitroomhq/postiz-app/blob/0f1647f7491a217d43eb5ae7a480484bdf0aff3e/libraries/nestjs-libraries/src/database/prisma/posts/posts.service.ts#L1056-L1092","documentation":"Character-count validation per provider: the variant's content exceeds maximumCharacters for that channel (which varies — e.g. ~280 for X, 2200 for Instagram, and different counts when media is attached). Applies to non-draft posts.","triggerScenarios":"Scheduling a post whose per-channel content length exceeds the provider max after counting URLs, mentions, and media adjustments — e.g. pasting a 300-character blurb into an X variant.","commonSituations":"Cross-posting long content to character-limited channels; link shorteners changing effective length; emoji counting as multiple characters; per-channel overrides not trimmed when the main composer text is long.","solutions":["Shorten the content for that channel to at or below maximumCharacters from the message","Use the per-channel override editor to tailor length instead of broadcasting one text","Move overflow into a thread or the first comment where the provider supports it","Add a live character counter per provider in the UI"],"exampleFix":"// before\n{ integration: { id: xId }, content: longText300Chars }\n// after\n{ integration: { id: xId }, content: longText.slice(0, maximumCharacters) }\n// or split into thread parts","handlingStrategy":"validation","validationCode":"const max = MAX_CHARS[providerIdentifier] ?? 5000;\nif (post.content.length > max) throw new Error(`Too long for ${providerIdentifier}: ${post.content.length}/${max}`);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Show a live per-channel character counter","Use per-channel overrides to shorten variants for tight channels","Split long content into threads where supported"],"tags":["posts","character-limit","validation","provider"],"backgroundTag":"content-length-exceeded","analyzedSha":"0f1647f7491a217d43eb5ae7a480484bdf0aff3e","analyzedAt":"2026-08-27T12:09:55.020Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}