Skip to content

Fix #2039: add serde(default) to trigger_descriptions and pinned_node_ids#902

Open
AlexMikhalev wants to merge 1 commit into
mainfrom
task/2039-serde-fix
Open

Fix #2039: add serde(default) to trigger_descriptions and pinned_node_ids#902
AlexMikhalev wants to merge 1 commit into
mainfrom
task/2039-serde-fix

Conversation

@AlexMikhalev
Copy link
Copy Markdown
Contributor

Summary

  • Adds #[serde(default)] to trigger_descriptions and pinned_node_ids fields in SerializableRoleGraph
  • Adds a regression test that deserialises old JSON (without those fields) and verifies it succeeds with empty collections

Problem

SerializableRoleGraph fields added by issue #84 lacked #[serde(default)], causing cache warm-up and persistence read-paths that load pre-#84 snapshots to fail with a serde missing-field error.

Test plan

  • cargo test -p terraphim_rolegraph serializable_rolegraph_deserializes_without_trigger_fields passes
  • cargo clippy -p terraphim_rolegraph -- -D warnings passes

Refs terraphim/terraphim-ai#2039 (Gitea)

Generated with Terraphim AI

…_node_ids Refs #2039

Old persisted SerializableRoleGraph JSON written before issue #84 was
merged lacked trigger_descriptions and pinned_node_ids fields. Without
#[serde(default)], deserialisation failed with a missing-field error,
breaking cache warm-up on any deployment with existing snapshots.

Adds regression test: strips both fields from a freshly serialised
graph, then verifies round-trip deserialisation succeeds with empty
collections.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant