{"record":{"id":"1c7635bfac071352","repo":"immich-app/immich","slug":"syncrequesttype-assetsv1-is-deprecated-use-syncre","errorCode":null,"errorMessage":"SyncRequestType.AssetsV1 is deprecated, use SyncRequestType.AssetsV2 instead","messagePattern":"SyncRequestType\\.AssetsV1 is deprecated, use SyncRequestType\\.AssetsV2 instead","errorType":"exception","errorClass":"BadRequestException","httpStatus":400,"severity":"error","filePath":"server/src/services/sync.service.ts","lineNumber":327,"sourceCode":"    }\n  }\n\n  private async syncPartnersV1(options: SyncQueryOptions, response: Writable, checkpointMap: CheckpointMap) {\n    const deleteType = SyncEntityType.PartnerDeleteV1;\n    const deletes = this.syncRepository.partner.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.PartnerV1;\n    const upserts = this.syncRepository.partner.getUpserts({ ...options, ack: checkpointMap[upsertType] });\n    for await (const { updateId, ...data } of upserts) {\n      await send(response, { type: upsertType, ids: [updateId], data });\n    }\n  }\n\n  private syncAssetsV1(): Promise<void> {\n    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(","sourceCodeStart":309,"sourceCodeEnd":345,"githubUrl":"https://github.com/immich-app/immich/blob/f48d4b332127ad365ba256108799ca8f571d2dd5/server/src/services/sync.service.ts#L309-L345","documentation":"The AssetsV1 sync request type is removed; the handler is a stub that immediately throws BadRequestException directing callers to AssetsV2. Server refuses to serve the deprecated v1 asset sync stream.","triggerScenarios":"A client includes SyncRequestType.AssetsV1 in its sync request list; handlers dispatches to syncAssetsV1 which always throws.","commonSituations":"Older Immich mobile app (pre AssetsV2) syncing against a newer server; cached sync request types not refreshed after server upgrade.","solutions":["Update the Immich mobile app to a version supporting SyncRequestType.AssetsV2","Remove AssetsV1 from the client's sync request list and use AssetsV2","Downgrade the server only as a temporary measure (not recommended)"],"exampleFix":"// before\nrequests: [{ type: SyncRequestType.AssetsV1 }]\n// after\nrequests: [{ type: SyncRequestType.AssetsV2 }]","handlingStrategy":"validation","validationCode":"const SUPPORTED = new Set(Object.values(SyncRequestType).filter(t => t.endsWith('V2')));\nif (requests.some(r => !SUPPORTED.has(r.type))) throw new Error('V1 sync types are deprecated; use V2');","typeGuard":"null","tryCatchPattern":"try {\n  await syncStream(requests);\n} catch (e) {\n  if (e.status === 400 && e.message.includes('deprecated, use')) {\n    requests = requests.map(r => upgradeToV2(r.type));\n  }\n}","preventionTips":["Keep the mobile app updated with the server","Migrate all sync request types from V1 to V2","Feature-detect supported types before syncing"],"tags":["sync","deprecated","api-version","bad-request"],"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"}