Skip to content

Commit

Permalink
Fix: Don't call batch functions with empty sequences
Browse files Browse the repository at this point in the history
  • Loading branch information
Christer van der Meeren committed Nov 7, 2024
1 parent a5ea02e commit d07f03e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
4 changes: 4 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ These are the release notes for Fling (the main package).
See [RELEASE_NOTES_Fling.Interop.Facil.md](RELEASE_NOTES_Fling.Interop.Facil.md) for the release notes for
Fling.Interop.Facil.

### 0.5.1 (2024-11-07)

* Fixed bug introduced in 0.5.0 where `...WithoutUpdate` functions would throw even if there was nothing to update

### 0.5.0 (2024-11-06)

* **Breaking** (hopefully not in practice): For to-many child entities, all deletes are performed first, then all
Expand Down
2 changes: 1 addition & 1 deletion src/Fling/Fling.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<!-- TODO: Create and add logo -->
<!--<PackageIcon>fling-logo-128x128.png</PackageIcon>-->
<PackageReleaseNotes>https://github.com/cmeeren/Fling/blob/master/RELEASE_NOTES.md</PackageReleaseNotes>
<Version>0.5.0</Version>
<Version>0.5.1</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
11 changes: 8 additions & 3 deletions src/Fling/Library.fs
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,14 @@ module Fling =
| true, oldChild when newChild <> oldChild -> toUpdate.Add newChild
| true, _ -> ()

do! batchDelete arg toDelete
do! batchUpdate arg toUpdate
do! batchInsert arg toInsert
if toDelete.Count > 0 then
do! batchDelete arg toDelete

if toUpdate.Count > 0 then
do! batchUpdate arg toUpdate

if toInsert.Count > 0 then
do! batchInsert arg toInsert

return result
}
Expand Down

0 comments on commit d07f03e

Please sign in to comment.