immich-app/immich · error · BadRequestException
withPartners is only supported for non-archived, non-trashed
Error message
withPartners is only supported for non-archived, non-trashed, non-favorited, non-locked assets
What it means
Thrown (as BadRequestException) by TimelineService when dto.withPartners is true and the request also filters by locked, archived, favorited, or trashed. Partner inclusion is only meaningful for the default visible timeline, so combining it with any narrowing filter is rejected rather than silently ignored.
Source
Thrown at server/src/services/timeline.service.ts:83
}
}
if (dto.tagId) {
await this.requireAccess({ auth, permission: Permission.TagRead, ids: [dto.tagId] });
}
if (auth.sharedLink && !auth.sharedLink.showExif) {
dto.withCoordinates = false;
}
if (dto.withPartners) {
const isRequestedLocked = dto.visibility === AssetVisibility.Locked;
const isRequestedArchived = dto.visibility === AssetVisibility.Archive || dto.visibility === undefined;
const isRequestedFavorite = dto.isFavorite === true || dto.isFavorite === false;
const isRequestedTrash = dto.isTrashed === true;
if (isRequestedLocked || isRequestedArchived || isRequestedFavorite || isRequestedTrash) {
throw new BadRequestException(
'withPartners is only supported for non-archived, non-trashed, non-favorited, non-locked assets',
);
}
}
}
}
View on GitHub (pinned to 199723261c)
Solutions
- Disable withPartners when filtering by archive/trash/favorite/locked.
- Set visibility=Visible (not undefined) and clear isFavorite/isTrashed before enabling withPartners.
- Run two separate requests: one with filters for self, one with withPartners for the partner scope.
Example fix
// before
buckets({ withPartners: true, visibility: AssetVisibility.Archive });
// after
buckets({ withPartners: true, visibility: AssetVisibility.Visible, isFavorite: undefined, isTrashed: undefined }); Defensive patterns
Strategy: validation
Validate before calling
function partnersCompatible(dto: TimelineQueryDto): boolean {
if (!dto.withPartners) return true;
const archived = dto.visibility === AssetVisibility.Archive || dto.visibility === undefined;
return !archived
&& dto.visibility !== AssetVisibility.Locked
&& dto.isFavorite === undefined
&& dto.isTrashed !== true;
}
if (!partnersCompatible(dto)) { /* disable withPartners or clear filters */ } Try / catch
try { await timelineApi.buckets(dto); }
catch (e) {
if (e instanceof BadRequestException && /withPartners/.test(e.message)) {
// split into two requests: filters for self, withPartners for visible scope
}
} Prevention
- UI: disable the 'show partners' toggle when any of archive/trash/favorite/locked is active.
- Always set visibility explicitly (Visible) rather than leaving undefined when using partners.
When it happens
Trigger: GET timeline/buckets or timeline/search with withPartners=true alongside visibility in {Locked, Archive, undefined}, or isFavorite defined, or isTrashed=true.
Common situations: Client toggles 'show partners' while a favorites/archive/trash filter is active; default visibility is undefined which also counts as archived-scope and triggers the guard.
Related errors
- You may not access another user's locked timeline
- assetIds, albumId, or userId is required
- Invalid job name
- Library ${id} not found
- Invalid import path: ${path.message}
AI-assisted analysis of immich-app/immich@199723261c (2026-08-12).
Data as JSON: /api/errors/068ca82e9c3474c4.
Report an issue: GitHub.