Skip to content

Conversation

@jqnatividad
Copy link
Collaborator

on missing keys when using old stats cache file

…sing keys when using old stats cache file

Co-Authored-By: Claude <81847+claude@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a panic issue in the stats command that occurred when reading old cache files missing newer fields (e.g., flag_weight). The fix refactors the JSON deserialization code to use safe .get() method calls instead of direct [] indexing.

Changes:

  • Added import for ValueObjectAccess trait to enable .get() method on OwnedValue
  • Introduced helper closures for safe field access with appropriate defaults
  • Refactored all field assignments in from_owned_value to use safe accessors

@jqnatividad jqnatividad merged commit 0fb1f79 into master Jan 12, 2026
23 checks passed
@jqnatividad jqnatividad deleted the stats-prevent-panics-on-old-stats-cache branch January 12, 2026 02:54
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.

2 participants