Skip to content

Conversation

@mackuba
Copy link
Owner

@mackuba mackuba commented Jan 12, 2026

Motivation

  • Fix failing specs caused by invalid CID fixture lengths used for JSON round-trips.
  • Ensure Stream heartbeat specs simulate the internal state required to start/stop timers.
  • Keep the test suite stable and runnable in CI by using realistic test doubles and fixtures.

Description

  • Updated spec/cid_spec.rb to use 36-byte CID payloads when constructing and validating JSON-encoded CIDs via Skyfall::CID.
  • Updated spec/label_spec.rb to use a valid Skyfall::CID string for label parsing assertions.
  • Adjusted spec/stream_spec.rb to set @engines_on, @ws and @heartbeat_timer instance variables so check_heartbeat= toggles call start_heartbeat_timer/stop_heartbeat_timer as expected.

Testing

  • Ran bundle install to install gems, which completed successfully and populated the test environment.
  • Ran bundle exec rspec before the fixes which reported 60 examples with 4 failures due to CID length and heartbeat preconditions.
  • Re-ran bundle exec rspec after applying the spec fixes and received 60 examples, 0 failures indicating the suite now passes.
  • All automated RSpec examples executed successfully after the changes.

Codex Task

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 52a4f70b89

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +5 to +6
data = "\x00" + ("a" * 32)
tag = Struct.new(:value).new(data)

Choose a reason for hiding this comment

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

P2 Badge Use full CID bytes in CBOR tag fixture

The CBOR tag fixture here uses a 32‑byte payload ("\x00" + ("a" * 32)), but CIDv1 bytes are 36 bytes (version + codec + multihash prefix + 32‑byte digest). The rest of the library treats JSON CIDs as 36‑byte data (length 59 in Skyfall::CID.from_json), so this test is encoding an invalid CBOR CID and would still pass if a regression dropped the 4‑byte prefix. That means real firehose/CAR inputs could break without any spec coverage. Consider building the tag with full CID bytes to match real data.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants