{"record":{"id":"f8fed3577079f2d9","repo":"DIYgod/RSSHub","slug":"provide-a-valid-misskey-username","errorCode":null,"errorMessage":"Provide a valid Misskey username","messagePattern":"Provide a valid Misskey username","errorType":"validation","errorClass":"InvalidParameterError","httpStatus":503,"severity":"warning","filePath":"lib/routes/misskey/user-timeline.ts","lineNumber":49,"sourceCode":"    },\n    features: {\n        requireConfig: false,\n        requirePuppeteer: false,\n        antiCrawler: false,\n        supportBT: false,\n        supportPodcast: false,\n        supportScihub: false,\n    },\n    name: 'User timeline',\n    maintainers: ['siygle', 'SnowAgar25', 'HanaokaYuzu'],\n    handler,\n};\n\nasync function handler(ctx): Promise<Data> {\n    const username = ctx.req.param('username');\n    const [, pureUsername, site] = username.match(/@?(\\w+)@(\\w+\\.\\w+)/) || [];\n    if (!pureUsername || !site) {\n        throw new InvalidParameterError('Provide a valid Misskey username');\n    }\n    if (!config.feature.allow_user_supply_unsafe_domain && !utils.allowSiteList.includes(site)) {\n        throw new ConfigNotFoundError(`This RSS is disabled unless 'ALLOW_USER_SUPPLY_UNSAFE_DOMAIN' is set to 'true'.`);\n    }\n\n    const routeParams = querystring.parse(ctx.req.param('routeParams'));\n    const withRenotes = fallback(undefined, queryToBoolean(routeParams.withRenotes), false);\n    const mediaOnly = fallback(undefined, queryToBoolean(routeParams.mediaOnly), false);\n    const simplifyAuthor = fallback(undefined, queryToBoolean(routeParams.simplifyAuthor), false);\n\n    // Check for conflicting parameters\n    if (withRenotes && mediaOnly) {\n        throw new InvalidParameterError('withRenotes and mediaOnly cannot both be true.');\n    }\n\n    const { accountData, avatarUrl } = await utils.getUserTimelineByUsername(pureUsername, site, {\n        withRenotes,\n        mediaOnly,","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/misskey/user-timeline.ts#L31-L67","documentation":"Thrown as InvalidParameterError by the Misskey user-timeline route when the :username parameter does not match the regex /@?(\\w+)@(\\w+\\.\\w+)/ — i.e. it is not a WebFinger 'acct' style identifier (user@host.tld, with optional leading @). The regex captures both the pure username and the host; failure to capture either is a client error.","triggerScenarios":"Caller requests /misskey/user-timeline/:username with a value like 'alice' (no host), 'alice@' (no domain), '@alice@host' where host has no dot, or a value containing characters outside \\w. pureUsername or site is undefined, so it throws.","commonSituations":"User supplies just the handle without the instance domain; user supplies a URL instead of an acct; the instance host is a single-label name without a TLD (rare).","solutions":["Format the username as an acct: '@user@instance.tld' or 'user@instance.tld' (the leading @ is optional), e.g. /misskey/user/@alice@misskey.io.","Ensure the host part has at least one dot (a real domain).","Strip any surrounding URL scheme or path before passing the value."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const username = ctx.req.param('username');\nconst m = username.match(/^@?(\\w+)@(\\w+\\.\\w+)$/);\nif (!m) {\n    throw new InvalidParameterError(`Provide a username in acct form user@host.tld (leading @ optional); got: ${username}`);\n}\nconst [, pureUsername, site] = m;","typeGuard":"function isAcct(username: string): boolean {\n    return typeof username === 'string' && /^@?\\w+@\\w+\\.\\w+$/.test(username);\n}","tryCatchPattern":null,"preventionTips":["Always build the parameter as user@host.tld, not a bare handle or URL.","Document the acct format prominently in the route parameters.","Reject values containing '://' early in any client feed-URL builder."],"tags":["invalid-parameter","validation","acct-format","regex","misskey"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}