Skip to content

Commit 5351c6c

Browse files
fix: a bug was introduced that was not capture in the tests, having this inside a future does not run unfortunatelly.
Changed to a batchUpdate to see if it handles better and does not crash Signed-off-by: goncalo-frade-iohk <[email protected]>
1 parent f202f9e commit 5351c6c

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

EdgeAgentSDK/Pluto/Sources/PersistentStorage/DAO/CDMessageDAO+MessageStore.swift

+5-7
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,11 @@ extension CDMessageDAO: MessageStore {
4444
.first()
4545
.map { $0.first }
4646
.flatMap { pair in
47-
Future {
48-
self.updateOrCreate(
49-
msg.id,
50-
context: writeContext
51-
) { cdobj, _ in
52-
try cdobj.fromDomain(msg: msg, direction: direction, pair: pair)
53-
}
47+
self.batchUpdateOrCreate(
48+
[msg.id],
49+
context: writeContext
50+
) { id, cdobj, _ in
51+
try cdobj.fromDomain(msg: msg, direction: direction, pair: pair)
5452
}
5553
}
5654
.map { _ in }

0 commit comments

Comments
 (0)