Skip to content

Commit 933d78a

Browse files
committed
fix for mutable object aliasing on validation
1 parent 6afa54b commit 933d78a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/mesh/agents/state/history/HistorySynchronizer.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -871,13 +871,16 @@ class HistorySynchronizer {
871871

872872
for (const idx of resp.omittedObjs.keys()) {
873873

874+
874875
const hash = resp.omittedObjs[idx];
875876
const omissionProof = resp.omittedObjsOwnershipProofs[idx];
876877

877878
const dep = await this.syncAgent.store.load(hash);
878-
879+
879880
if (dep !== undefined && dep.hash(reqInfo.request.omissionProofsSecret) === omissionProof) {
880-
reqInfo.receivedObjects?.objects.set(dep.hash(), dep);
881+
if (reqInfo.receivedObjects?.objects?.get(dep.hash()) === undefined) {
882+
reqInfo.receivedObjects?.objects.set(dep.hash(), dep);
883+
}
881884
}
882885
}
883886

0 commit comments

Comments
 (0)