fix(server): new full sync return stacked assets individually (#9189)

* fix(server): new full sync return stacked assets individually

* return archived partner assets (like old getAllAssets)

* fix

* fix test

---------

Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
Fynn Petersen-Frey
2024-05-14 17:30:33 +02:00
committed by GitHub
parent 77b8c2f330
commit 4d7aa7effd
5 changed files with 5 additions and 17 deletions

View File

@@ -741,12 +741,11 @@ export class AssetRepository implements IAssetRepository {
],
})
getAllForUserFullSync(options: AssetFullSyncOptions): Promise<AssetEntity[]> {
const { ownerId, isArchived, withStacked, lastCreationDate, lastId, updatedUntil, limit } = options;
const { ownerId, lastCreationDate, lastId, updatedUntil, limit } = options;
const builder = this.getBuilder({
userIds: [ownerId],
exifInfo: true,
withStacked,
isArchived,
exifInfo: true, // also joins stack information
withStacked: false, // return all assets individually as expected by the app
});
if (lastCreationDate !== undefined && lastId !== undefined) {
@@ -767,9 +766,9 @@ export class AssetRepository implements IAssetRepository {
@GenerateSql({ params: [{ userIds: [DummyValue.UUID], updatedAfter: DummyValue.DATE }] })
getChangedDeltaSync(options: AssetDeltaSyncOptions): Promise<AssetEntity[]> {
const builder = this.getBuilder({ userIds: options.userIds, exifInfo: true, withStacked: true })
const builder = this.getBuilder({ userIds: options.userIds, exifInfo: true, withStacked: false })
.andWhere({ updatedAt: MoreThan(options.updatedAfter) })
.take(options.limit)
.limit(options.limit)
.withDeleted();
return builder.getMany();