Skip to content

Commit

Permalink
better debug print
Browse files Browse the repository at this point in the history
  • Loading branch information
zorancv committed Jan 31, 2025
1 parent 166c909 commit 515fdbc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
9 changes: 7 additions & 2 deletions graph/src/components/store/entity_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,13 @@ impl EntityCache {
let mut entity = entity;
let old_vid = entity.set_vid(vid).expect("the vid should be set");
// Make sure that there was no VID previously set for this entity.
if old_vid.is_some() {
bail!("VID was already present when set in EntityCache");
if let Some(ovid) = old_vid {
bail!(
"VID: {} of entity: {} with ID: {} was already present when set in EntityCache",
ovid,
key.entity_type,
entity.id()
);
}

self.entity_op(key.clone(), EntityOp::Update(entity));
Expand Down
4 changes: 2 additions & 2 deletions graph/src/data/subgraph/api_version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ pub const SPEC_VERSION_1_2_0: Version = Version::new(1, 2, 0);

// Enables subgraphs as datasource.
// Changes the way the VID field is generated. It used to be autoincrement. Now its
// based on block number and the order of the entities in a block. The later is
// representing the writting order of all entity types in a subgraph.
// based on block number and the order of the entities in a block. The latter
// represents the write order across all entity types in the subgraph.
pub const SPEC_VERSION_1_3_0: Version = Version::new(1, 3, 0);

// The latest spec version available
Expand Down

0 comments on commit 515fdbc

Please sign in to comment.