diff --git a/backend/FwLite/FwLiteShared/Sync/SyncService.cs b/backend/FwLite/FwLiteShared/Sync/SyncService.cs index c5eead34c..7a7647792 100644 --- a/backend/FwLite/FwLiteShared/Sync/SyncService.cs +++ b/backend/FwLite/FwLiteShared/Sync/SyncService.cs @@ -53,7 +53,7 @@ private async Task SendNotifications(SyncResults syncResults) await foreach (var entryId in syncResults.MissingFromLocal .SelectMany(c => c.Snapshots, (commit, snapshot) => snapshot.Entity) .ToAsyncEnumerable() - .SelectAwait(async e => await GetEntryId(e.DbObject as IObjectWithId)) + .SelectMany(e => GetEntryId(e.DbObject as IObjectWithId)) .Distinct()) { if (entryId is null) continue; @@ -74,15 +74,26 @@ private async Task SendNotifications(SyncResults syncResults) } } - private async ValueTask GetEntryId(IObjectWithId? entity) + private async IAsyncEnumerable GetEntryId(IObjectWithId? entity) { - return entity switch + switch (entity) { - Entry entry => entry.Id, - Sense sense => sense.EntryId, - ExampleSentence exampleSentence => (await dataModel.GetLatest(exampleSentence.SenseId))?.EntryId, - _ => null - }; + case Entry entry: + yield return entry.Id; + break; + case Sense sense: + yield return sense.EntryId; + break; + case ExampleSentence exampleSentence: + yield return (await dataModel.GetLatest(exampleSentence.SenseId))?.EntryId; + break; + case ComplexFormComponent complexFormComponent: + yield return complexFormComponent.ComplexFormEntryId; + yield return complexFormComponent.ComponentEntryId; + break; + default: + break; + } } public async Task UploadProject(Guid lexboxProjectId, LexboxServer server)