DIYgod/RSSHub · warning · InvalidParameterError
withRenotes and mediaOnly cannot both be true.
Error message
withRenotes and mediaOnly cannot both be true.
What it means
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.
Source
Thrown at lib/routes/misskey/user-timeline.ts:62
async function handler(ctx): Promise<Data> {
const username = ctx.req.param('username');
const [, pureUsername, site] = username.match(/@?(\w+)@(\w+\.\w+)/) || [];
if (!pureUsername || !site) {
throw new InvalidParameterError('Provide a valid Misskey username');
}
if (!config.feature.allow_user_supply_unsafe_domain && !utils.allowSiteList.includes(site)) {
throw new ConfigNotFoundError(`This RSS is disabled unless 'ALLOW_USER_SUPPLY_UNSAFE_DOMAIN' is set to 'true'.`);
}
const routeParams = querystring.parse(ctx.req.param('routeParams'));
const withRenotes = fallback(undefined, queryToBoolean(routeParams.withRenotes), false);
const mediaOnly = fallback(undefined, queryToBoolean(routeParams.mediaOnly), false);
const simplifyAuthor = fallback(undefined, queryToBoolean(routeParams.simplifyAuthor), false);
// Check for conflicting parameters
if (withRenotes && mediaOnly) {
throw new InvalidParameterError('withRenotes and mediaOnly cannot both be true.');
}
const { accountData, avatarUrl } = await utils.getUserTimelineByUsername(pureUsername, site, {
withRenotes,
mediaOnly,
});
return {
title: `User timeline for ${username} on ${site}`,
link: `https://${site}/@${pureUsername}`,
image: avatarUrl ?? '',
item: utils.parseNotes(accountData, site, simplifyAuthor),
};
}
View on GitHub (pinned to bed535e087)
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.
Defensive patterns
Strategy: validation
Validate before calling
const withRenotes = queryToBoolean(routeParams.withRenotes);
const mediaOnly = queryToBoolean(routeParams.mediaOnly);
if (withRenotes && mediaOnly) {
throw new InvalidParameterError('withRenotes and mediaOnly are mutually exclusive; choose one.');
} Type guard
function areValidFilters(withRenotes: boolean, mediaOnly: boolean): boolean {
return !(withRenotes && mediaOnly);
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: A user copy-pastes filter flags from docs without realizing they conflict; a feed builder UI that lets users tick both boxes.
Related errors
- Provide a valid Misskey username
- Invalid category
- At least one valid search parameter is required
- 无法检测 Discuz 版本,请在路由中指定版本参数,如 /discuz/x/ 或 /discuz/7/
- 通知类型${typeParam}未定义
AI-assisted analysis of DIYgod/RSSHub@bed535e087 (2026-08-12).
Data as JSON: /api/errors/598e4ec38dbecd19.
Report an issue: GitHub.