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

  1. Disable withPartners when filtering by archive/trash/favorite/locked.
  2. Set visibility=Visible (not undefined) and clear isFavorite/isTrashed before enabling withPartners.
  3. 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

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


AI-assisted analysis of immich-app/immich@199723261c (2026-08-12). Data as JSON: /api/errors/068ca82e9c3474c4. Report an issue: GitHub.