{"record":{"id":"997e035b76be29c5","repo":"Mintplex-Labs/anything-llm","slug":"bio-cannot-be-longer-than-1-000-characters","errorCode":null,"errorMessage":"Bio cannot be longer than 1,000 characters","messagePattern":"Bio cannot be longer than 1,000 characters","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"server/models/user.js","lineNumber":73,"sourceCode":"          `Invalid role. Allowed roles are: ${VALID_ROLES.join(\", \")}`\n        );\n      }\n      return String(role);\n    },\n    dailyMessageLimit: (dailyMessageLimit = null) => {\n      if (dailyMessageLimit === null) return null;\n      const limit = Number(dailyMessageLimit);\n      if (isNaN(limit) || limit < 1) {\n        throw new Error(\n          \"Daily message limit must be null or a number greater than or equal to 1\"\n        );\n      }\n      return limit;\n    },\n    bio: (bio = \"\") => {\n      if (!bio || typeof bio !== \"string\") return \"\";\n      if (bio.length > 1000)\n        throw new Error(\"Bio cannot be longer than 1,000 characters\");\n      return String(bio);\n    },\n  },\n  // validations for the above writable fields.\n  castColumnValue: function (key, value) {\n    switch (key) {\n      case \"suspended\":\n        return Number(Boolean(value));\n      case \"dailyMessageLimit\":\n        return value === null ? null : Number(value);\n      default:\n        return String(value);\n    }\n  },\n\n  filterFields: function (user = {}) {\n    const {\n      password: _password,","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/526360e320da9d1b36074be5ed64fe76e5bbfbbd/server/models/user.js#L55-L91","documentation":"Thrown by User.validations.bio when the bio string exceeds 1000 characters. Non-string or falsy bios are accepted (returned as empty string); only an over-length string fails. Runs during User.create (line 131).","triggerScenarios":"Creating/updating a user with a bio longer than 1000 characters.","commonSituations":"User pastes a long CV/resume into the bio field. Programmatic profile sync brings an oversized description.","solutions":["Trim the bio to 1000 characters or fewer.","Set maxlength=1000 on the bio textarea in the UI and show a live counter.","Truncate imported bios to the limit."],"exampleFix":"// before\nUser.create({ username, password, bio: longDescription });\n// after\nUser.create({ username, password, bio: longDescription.slice(0, 1000) });","handlingStrategy":"validation","validationCode":"if (typeof bio === 'string' && bio.length > 1000) bio = bio.slice(0, 1000);","typeGuard":"const isBioLengthOk = (b) => typeof b !== 'string' || b.length <= 1000;","tryCatchPattern":null,"preventionTips":["Add maxlength=1000 and a live counter to the bio field.","Truncate imported bios to 1000 characters."],"tags":["validation","user","length-limit"],"backgroundTag":null,"analyzedSha":"526360e320da9d1b36074be5ed64fe76e5bbfbbd","analyzedAt":"2026-08-13T01:45:47.170Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}