Skip to content

Commit 7988c8a

Browse files
author
Zoran Cvetkov
committed
fix wrong merge
1 parent 8aa3585 commit 7988c8a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

graph/src/components/store/entity_cache.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ impl EntityCache {
288288
) -> Result<Option<Entity>, anyhow::Error> {
289289
match op {
290290
EntityOp::Update(entity) | EntityOp::Overwrite(entity)
291-
if query.matches(key, &entity) =>
291+
if query.matches(key, entity) =>
292292
{
293293
Ok(Some(entity.clone()))
294294
}
@@ -383,6 +383,7 @@ impl EntityCache {
383383

384384
// The next VID is based on a block number and a sequence within the block
385385
let vid = ((block as i64) << 32) + self.vid_seq as i64;
386+
self.vid_seq += 1;
386387
let mut entity = entity;
387388
let old_vid = entity.set_vid(vid).expect("the vid should be set");
388389
// Make sure that there was no VID previously set for this entity.
@@ -395,6 +396,8 @@ impl EntityCache {
395396
);
396397
}
397398

399+
self.entity_op(key.clone(), EntityOp::Update(entity));
400+
398401
// The updates we were given are not valid by themselves; force a
399402
// lookup in the database and check again with an entity that merges
400403
// the existing entity with the changes

0 commit comments

Comments
 (0)