{"record":{"id":"598e4ec38dbecd19","repo":"DIYgod/RSSHub","slug":"withrenotes-and-mediaonly-cannot-both-be-true","errorCode":null,"errorMessage":"withRenotes and mediaOnly cannot both be true.","messagePattern":"withRenotes and mediaOnly cannot both be true\\.","errorType":"validation","errorClass":"InvalidParameterError","httpStatus":503,"severity":"warning","filePath":"lib/routes/misskey/user-timeline.ts","lineNumber":62,"sourceCode":"\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,\n    });\n\n    return {\n        title: `User timeline for ${username} on ${site}`,\n        link: `https://${site}/@${pureUsername}`,\n        image: avatarUrl ?? '',\n        item: utils.parseNotes(accountData, site, simplifyAuthor),\n    };\n}\n","sourceCodeStart":44,"sourceCodeEnd":77,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/misskey/user-timeline.ts#L44-L77","documentation":"Thrown as InvalidParameterError by the Misskey user-timeline route when routeParams contains both withRenotes=true and mediaOnly=true. These are mutually exclusive filters: withRenotes asks to include boosts, mediaOnly asks for media-only posts; combining them is logically contradictory and the route explicitly rejects it after parsing routeParams.","triggerScenarios":"Caller appends routeParams=withRenotes:1,mediaOnly:1 (or both as booleans) to the request. The handler parses both to true via queryToBoolean, hits the `if (withRenotes && mediaOnly)` check, and throws.","commonSituations":"A user copy-pastes filter flags from docs without realizing they conflict; a feed builder UI that lets users tick both boxes.","solutions":["Choose one filter: routeParams=withRenotes:1 OR routeParams=mediaOnly:1, not both.","If you want media-only posts that include renotes of media, note the API cannot express that in one call — request mediaOnly and accept that boosts are excluded by design.","Update any client/feed-URL generator to make the two options mutually exclusive in the UI."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const withRenotes = queryToBoolean(routeParams.withRenotes);\nconst mediaOnly = queryToBoolean(routeParams.mediaOnly);\nif (withRenotes && mediaOnly) {\n    throw new InvalidParameterError('withRenotes and mediaOnly are mutually exclusive; choose one.');\n}","typeGuard":"function areValidFilters(withRenotes: boolean, mediaOnly: boolean): boolean {\n    return !(withRenotes && mediaOnly);\n}","tryCatchPattern":null,"preventionTips":["Make withRenotes and mediaOnly a single radio-style enum in any UI that builds the feed URL.","Document the mutual exclusion in the route description.","Parse and validate routeParams as early as possible to fail fast."],"tags":["invalid-parameter","conflicting-params","validation","misskey"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}