{"record":{"id":"ec041ea04fb60e37","repo":"immich-app/immich","slug":"syncrequesttype-partnerassetsv1-is-deprecated-use","errorCode":null,"errorMessage":"SyncRequestType.PartnerAssetsV1 is deprecated, use SyncRequestType.PartnerAssetsV2 instead","messagePattern":"SyncRequestType\\.PartnerAssetsV1 is deprecated, use SyncRequestType\\.PartnerAssetsV2 instead","errorType":"exception","errorClass":"BadRequestException","httpStatus":400,"severity":"error","filePath":"server/src/services/sync.service.ts","lineNumber":345,"sourceCode":"    throw new BadRequestException('SyncRequestType.AssetsV1 is deprecated, use SyncRequestType.AssetsV2 instead');\n  }\n\n  private async syncAssetsV2(options: SyncQueryOptions, response: Writable, checkpointMap: CheckpointMap) {\n    const deleteType = SyncEntityType.AssetDeleteV1;\n    const deletes = this.syncRepository.asset.getDeletes({ ...options, ack: checkpointMap[deleteType] });\n    for await (const { id, ...data } of deletes) {\n      await send(response, { type: deleteType, ids: [id], data });\n    }\n\n    const upsertType = SyncEntityType.AssetV2;\n    const upserts = this.syncRepository.asset.getUpserts({ ...options, ack: checkpointMap[upsertType] });\n    for await (const { updateId, ...data } of upserts) {\n      await send(response, { type: upsertType, ids: [updateId], data: mapSyncAssetV2(data) });\n    }\n  }\n\n  private syncPartnerAssetsV1(): Promise<void> {\n    throw new BadRequestException(\n      'SyncRequestType.PartnerAssetsV1 is deprecated, use SyncRequestType.PartnerAssetsV2 instead',\n    );\n  }\n\n  private async syncPartnerAssetsV2(\n    options: SyncQueryOptions,\n    response: Writable,\n    checkpointMap: CheckpointMap,\n    sessionId: string,\n  ) {\n    const deleteType = SyncEntityType.PartnerAssetDeleteV1;\n    const deletes = this.syncRepository.partnerAsset.getDeletes({ ...options, ack: checkpointMap[deleteType] });\n    for await (const { id, ...data } of deletes) {\n      await send(response, { type: deleteType, ids: [id], data });\n    }\n\n    const backfillType = SyncEntityType.PartnerAssetBackfillV2;\n    const backfillCheckpoint = checkpointMap[backfillType];","sourceCodeStart":327,"sourceCodeEnd":363,"githubUrl":"https://github.com/immich-app/immich/blob/f48d4b332127ad365ba256108799ca8f571d2dd5/server/src/services/sync.service.ts#L327-L363","documentation":"Generic deprecation guard: syncPartnerAssetsV1 rejects sync requests that still ask for the old SyncRequestType.PartnerAssetsV1 protocol, directing clients to migrate to PartnerAssetsV2. It throws unconditionally whenever the legacy sync type is selected, acting as a hard cutover so old partner-asset sync sessions cannot continue; the at-fault input is the deprecated SyncRequestType.PartnerAssetsV1 query parameter.","triggerScenarios":"Client requests SyncRequestType.PartnerAssetsV1 in a sync query; handlers routes to syncPartnerAssetsV1 which always throws.","commonSituations":"Outdated mobile client after server upgrade; partner-sharing sync codepaths in older apps.","solutions":["Update the Immich mobile app to a PartnerAssetsV2-capable version","Switch the client sync request to SyncRequestType.PartnerAssetsV2"],"exampleFix":"// before\nrequests: [{ type: SyncRequestType.PartnerAssetsV1 }]\n// after\nrequests: [{ type: SyncRequestType.PartnerAssetsV2 }]","handlingStrategy":"validation","validationCode":"if (requests.some(r => r.type === SyncRequestType.PartnerAssetsV1)) throw new Error('Use PartnerAssetsV2');","typeGuard":"null","tryCatchPattern":"try {\n  await syncStream(requests);\n} catch (e) {\n  if (e.status === 400 && e.message.includes('PartnerAssetsV1')) {\n    requests = requests.map(r => r.type === 'PartnerAssetsV1' ? { ...r, type: 'PartnerAssetsV2' } : r);\n  }\n}","preventionTips":["Use PartnerAssetsV2 in sync requests","Keep client/server versions aligned","Handle deprecated-type errors by auto-upgrading request types"],"tags":["sync","deprecated","api-version","partner-assets"],"backgroundTag":"deprecated-api-usage","analyzedSha":"f48d4b332127ad365ba256108799ca8f571d2dd5","analyzedAt":"2026-09-15T07:20:19.675Z","contentChangedAt":"2026-09-15T07:20:19.675Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}