Skip to content

Commit

Permalink
Address various review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
rmunn committed Jan 8, 2025
1 parent dd15ca8 commit 295c23e
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 13 deletions.
10 changes: 0 additions & 10 deletions backend/FwLite/LcmCrdt.Tests/Changes/JsonPatchChangeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,4 @@ public void NewChangeIPatchDoc_ThrowsForRemoveAtIndex()
var act = () => new JsonPatchChange<Entry>(Guid.NewGuid(), patch);
act.Should().Throw<NotSupportedException>();
}

// TODO: Doesn't work now that Sense.PartOfSpeech is an object. Rewrite or toss?
// [Fact]
// public void NewPatchDoc_ThrowsForIndexBasedPath()
// {
// var patch = new JsonPatchDocument<Entry>();
// patch.Replace(entry => entry.Senses[0].PartOfSpeech, "noun");
// var act = () => new JsonPatchChange<Entry>(Guid.NewGuid(), patch);
// act.Should().Throw<NotSupportedException>();
// }
}
1 change: 0 additions & 1 deletion backend/FwLite/LcmCrdt/Changes/SetPartOfSpeechChange.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ public override async ValueTask ApplyChange(Sense entity, ChangeContext context)
if (PartOfSpeechId is null)
{
entity.PartOfSpeechId = null;
entity.PartOfSpeech = null;
return;
}

Expand Down
1 change: 0 additions & 1 deletion backend/FwLite/MiniLcm/SyncHelpers/SenseSync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ public static async Task<int> Sync(Guid entryId,

if (beforeSense.PartOfSpeechId != afterSense.PartOfSpeechId)
{
patchDocument.Replace(sense => sense.PartOfSpeech, afterSense.PartOfSpeech);
patchDocument.Replace(sense => sense.PartOfSpeechId, afterSense.PartOfSpeechId);
}

Expand Down
2 changes: 1 addition & 1 deletion backend/LfClassicData/LfClassicMiniLcmApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ private async IAsyncEnumerable<Entry> Query(QueryOptions? options = null, string

await foreach (var entry in Entries.Aggregate(pipeline).ToAsyncEnumerable())
{
yield return await ToEntry(entry); // TODO: Is there a way to turn this into a .Select()? Because "yield return await" looks a little unwieldy
yield return await ToEntry(entry);
}
}

Expand Down

0 comments on commit 295c23e

Please sign in to comment.