Skip to content

Commit d07f03e

Browse files
author
Christer van der Meeren
committed
Fix: Don't call batch functions with empty sequences
1 parent a5ea02e commit d07f03e

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

RELEASE_NOTES.md

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ These are the release notes for Fling (the main package).
55
See [RELEASE_NOTES_Fling.Interop.Facil.md](RELEASE_NOTES_Fling.Interop.Facil.md) for the release notes for
66
Fling.Interop.Facil.
77

8+
### 0.5.1 (2024-11-07)
9+
10+
* Fixed bug introduced in 0.5.0 where `...WithoutUpdate` functions would throw even if there was nothing to update
11+
812
### 0.5.0 (2024-11-06)
913

1014
* **Breaking** (hopefully not in practice): For to-many child entities, all deletes are performed first, then all

src/Fling/Fling.fsproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<!-- TODO: Create and add logo -->
1616
<!--<PackageIcon>fling-logo-128x128.png</PackageIcon>-->
1717
<PackageReleaseNotes>https://github.com/cmeeren/Fling/blob/master/RELEASE_NOTES.md</PackageReleaseNotes>
18-
<Version>0.5.0</Version>
18+
<Version>0.5.1</Version>
1919
</PropertyGroup>
2020

2121
<ItemGroup>

src/Fling/Library.fs

+8-3
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,14 @@ module Fling =
8585
| true, oldChild when newChild <> oldChild -> toUpdate.Add newChild
8686
| true, _ -> ()
8787

88-
do! batchDelete arg toDelete
89-
do! batchUpdate arg toUpdate
90-
do! batchInsert arg toInsert
88+
if toDelete.Count > 0 then
89+
do! batchDelete arg toDelete
90+
91+
if toUpdate.Count > 0 then
92+
do! batchUpdate arg toUpdate
93+
94+
if toInsert.Count > 0 then
95+
do! batchInsert arg toInsert
9196

9297
return result
9398
}

0 commit comments

Comments
 (0)