fix: asset update race condition

This commit is contained in:
Daniel Dietzler
2025-12-04 15:33:44 +01:00
parent 77926383db
commit 40b07ec42e
17 changed files with 316 additions and 133 deletions

View File

@@ -288,10 +288,13 @@ describe(SyncRequestType.AlbumAssetExifsV1, () => {
// update the asset
const assetRepository = ctx.get(AssetRepository);
await assetRepository.upsertExif({
assetId: asset.id,
city: 'New City',
});
await assetRepository.upsertExif(
{
assetId: asset.id,
city: 'New City',
},
{ lockedPropertiesBehavior: 'update' },
);
await expect(ctx.syncStream(auth, [SyncRequestType.AlbumAssetExifsV1])).resolves.toEqual([
{
@@ -346,10 +349,13 @@ describe(SyncRequestType.AlbumAssetExifsV1, () => {
// update the asset
const assetRepository = ctx.get(AssetRepository);
await assetRepository.upsertExif({
assetId: assetDelayedExif.id,
city: 'Delayed Exif',
});
await assetRepository.upsertExif(
{
assetId: assetDelayedExif.id,
city: 'Delayed Exif',
},
{ lockedPropertiesBehavior: 'update' },
);
await expect(ctx.syncStream(auth, [SyncRequestType.AlbumAssetExifsV1])).resolves.toEqual([
{