{"record":{"id":"3d913371cbb8ddea","repo":"RocketChat/Rocket.Chat","slug":"error-bio-size-exceeded","errorCode":"error-bio-size-exceeded","errorMessage":"Bio size exceeds ${MAX_BIO_LENGTH} characters","messagePattern":"Bio size exceeds (.+?) characters","errorType":"exception","errorClass":"MeteorError","httpStatus":null,"severity":"error","filePath":"apps/meteor/server/lib/users/saveUser/handleBio.ts","lineNumber":12,"sourceCode":"import { MeteorError } from '@rocket.chat/core-services';\nimport type { IUser } from '@rocket.chat/core-typings';\nimport type { Updater } from '@rocket.chat/model-typings';\n\nimport type { SaveUserData } from './saveUser';\n\nconst MAX_BIO_LENGTH = 260;\n\nexport const handleBio = (userUpdater: Updater<IUser>, bio: SaveUserData['bio']) => {\n\tif (bio?.trim()) {\n\t\tif (bio.length > MAX_BIO_LENGTH) {\n\t\t\tthrow new MeteorError('error-bio-size-exceeded', `Bio size exceeds ${MAX_BIO_LENGTH} characters`, {\n\t\t\t\tmethod: 'saveUserProfile',\n\t\t\t});\n\t\t}\n\t\tuserUpdater.set('bio', bio);\n\t} else {\n\t\tuserUpdater.unset('bio');\n\t}\n};\n","sourceCodeStart":1,"sourceCodeEnd":21,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/server/lib/users/saveUser/handleBio.ts#L1-L21","documentation":"saveUserProfile's bio handler throws error-bio-size-exceeded (MeteorError, method 'saveUserProfile') when the submitted bio is longer than 260 characters. The check uses the raw bio.length, so it fires even if the extra length is only whitespace; a whitespace-only bio is treated as empty and unsets the field instead.","triggerScenarios":"Profile save with a bio of 261+ characters: pasted 'about me' text, link lists, or bios imported from another system; client textarea without a maxLength attribute.","commonSituations":"Users pasting long bios pasted from LinkedIn/social profiles; mobile keyboards inserting trailing newlines pushing length over the limit.","solutions":["Enforce maxLength=260 on the bio input in the UI so the server guard never triggers","Trim/validate bio.length <= 260 before calling the profile-save method","If a longer bio is a product requirement, this limit is hard-coded (MAX_BIO_LENGTH in handleBio.ts) and requires a source change"],"exampleFix":"// before\nawait saveUserProfile({ bio }); // 300 chars -> error-bio-size-exceeded\n\n// after\nconst MAX_BIO_LENGTH = 260;\nconst bio = rawBio.slice(0, MAX_BIO_LENGTH); // or block submit when over\nawait saveUserProfile({ bio });","handlingStrategy":"validation","validationCode":"const MAX_BIO_LENGTH = 260; // must match handleBio.ts\nif (bio && bio.length > MAX_BIO_LENGTH) {\n  throw new Error(`Bio must be at most ${MAX_BIO_LENGTH} characters`);\n}\nawait saveUserProfile({ bio });","typeGuard":"const isBioWithinLimit = (bio: string | undefined): boolean => !bio || bio.length <= 260;","tryCatchPattern":"try {\n  await saveUserProfile({ bio });\n} catch (e) {\n  if (isMeteorErrorCode(e, 'error-bio-size-exceeded')) {\n  \tshowCounterError('bio', 260);\n  }\n}","preventionTips":["Set maxLength=260 on the bio textarea and show a live character counter","Remember the server measures raw length, untrimmed"],"tags":["users","profile","bio","validation","length-limit"],"backgroundTag":"max-length-exceeded","analyzedSha":"b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0","analyzedAt":"2026-08-18T15:26:39.429Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}