Skip to content

Conversation

DZakh
Copy link
Member

@DZakh DZakh commented Sep 15, 2025

Summary by CodeRabbit

  • Bug Fixes
    • Corrected trace data JSON field naming to use “type,” aligning with transaction fields. Improves interoperability with JSON consumers and prevents parsing issues.
  • Chores
    • Bumped package version to 0.6.7.

@DZakh DZakh requested a review from JonoPrest September 15, 2025 15:09
Copy link

coderabbitai bot commented Sep 15, 2025

Walkthrough

Incremented package version to 0.6.7 and updated Serde serialization for TraceField.Kind to map to JSON key "type" in src/query.rs. No other changes.

Changes

Cohort / File(s) Summary
Version bump
package.json
Updated "version" from "0.6.6" to "0.6.7" for @envio-dev/hypersync-client.
Serde mapping for TraceField.Kind
src/query.rs
Added #[serde(rename = "type")] to TraceField::Kind to serialize/deserialize with JSON key "type", aligning with existing mapping in TransactionField.

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant Serializer
  participant JSON

  Client->>Serializer: Serialize TraceField (Kind)
  Serializer->>JSON: Emit field "type"
  Note right of JSON: "Kind" mapped to JSON key "type"

  Client->>Serializer: Deserialize JSON with "type"
  Serializer->>Client: Populate TraceField::Kind
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

A bunny bumps the version—hop, hop, hooray!
Now Kind says "type" in a tidy array.
Fields align, carrots in a row,
JSON burrows where mappings flow.
Ears up, tail flick—release on the way!

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "Fix trace type field selection" accurately and concisely describes the main change in the PR — adding a serde rename to TraceField.Kind so it maps to the JSON "type" field and corrects selection/serialization behavior in src/query.rs; the package.json version bump is a secondary, consistent patch update.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dz/fix-trace-type-field

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 07136c7 and 443b32b.

📒 Files selected for processing (2)
  • package.json (1 hunks)
  • src/query.rs (1 hunks)
🔇 Additional comments (2)
package.json (1)

4-4: Version bump to 0.6.7 — OK.

Looks good for a patch release tied to the Rust-side fix.

Please confirm a changelog entry and that release artifacts will be published for the configured N-API triples.

src/query.rs (1)

191-193: Map TraceField::Kind to JSON "type" — correct and consistent.

This mirrors TransactionField and aligns with the server schema. Nice catch.

Recommend adding a small serde test to lock this in:

#[test]
fn trace_field_kind_serializes_to_type() {
    use serde_json::Value;
    let v = serde_json::to_value(&TraceField::Kind).unwrap();
    assert_eq!(v, Value::String("type".to_string()));
}

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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