Skip to content

fix cmdAbortHistorical missing profile param - #62

Merged
abdulsaheel merged 1 commit into
mainfrom
fix/abort-historical-gen5-profile
Sep 19, 2026
Merged

abdulsaheel merged 1 commit into
mainfrom
fix/abort-historical-gen5-profile

Conversation

@abdulsaheel

@abdulsaheel abdulsaheel commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

cmdAbortHistorical was the one command in the labrador prepare/start
sequence (20 abort -> 123 select wrist -> 139 -> 125 -> 124) that never
got the profile param the others got. a gen5 caller passing
profile: BandProfile.gen5 to selectWrist/labradorFiltered/etc had no
way to do the same for the abort step, so it silently framed as gen4
(4-byte header, crc8) on a gen5 link expecting 8-byte header + crc16-modbus.

adds the optional profile param (defaults gen4, so nothing existing
changes) and a test mirroring the existing gen5 command-surface tests.

Summary by Sourcery

Add profile support to the historical-transmit abort command so Labrador sequences can correctly operate on Gen5 links.

Bug Fixes:

  • Make the historical-transmit abort command support Gen5 framing while preserving Gen4 default behavior.

Tests:

  • Add coverage confirming profile-aware Gen5 framing and backward-compatible Gen4 framing for the abort command.

Summary by CodeRabbit

  • New Features

    • Added support for building abort-history commands using the gen5 frame format.
    • Retained gen4 framing as the default behavior for compatibility.
  • Tests

    • Added coverage validating gen4 defaults and gen5 framing behavior.

it was the one command in the labrador prepare/start sequence
(20 -> 123 -> 139 -> 125 -> 124) that never got the profile param
when the others did. a gen5 caller had no way to make its abort
step frame as gen5, so it silently sent a gen4 frame the strap
can't parse.

defaults to gen4, so existing callers are unaffected.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sorry @abdulsaheel, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 6 days and 8 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@coderabbitai

coderabbitai Bot commented Sep 19, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 2f973fe6-748b-4529-9e0c-e4114d82272d

📥 Commits

Reviewing files that changed from the base of the PR and between 54f128e and 755a069.

📒 Files selected for processing (2)
  • lib/src/commands.dart
  • test/gen5_command_surface_test.dart

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

cmdAbortHistorical now accepts an optional BandProfile. It forwards the profile to frame construction. Tests cover gen5 framing and the default gen4 behavior.

Changes

Abort command profile support

Layer / File(s) Summary
Profile-aware command and compatibility coverage
lib/src/commands.dart, test/gen5_command_surface_test.dart
cmdAbortHistorical accepts an optional profile and forwards it to buildCommand. Tests verify gen5 framing, gen4 incompatibility, opcode preservation, and the default gen4 framing.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

Suggested reviewers: pablodvs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: adding the missing profile parameter to cmdAbortHistorical.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

@sourcery-ai

sourcery-ai Bot commented Sep 19, 2026

Copy link
Copy Markdown

Reviewer's Guide

Adds optional BandProfile support to cmdAbortHistorical and forwards it into buildCommand, enabling correctly framed gen5 Labrador abort commands while retaining gen4 default behavior; tests cover both profile-specific framing and compatibility.

Sequence diagram for profile-aware historical abort command

sequenceDiagram
    participant Caller
    participant cmdAbortHistorical
    participant buildCommand
    participant Labrador

    Caller->>cmdAbortHistorical: cmdAbortHistorical(seq, profile)
    cmdAbortHistorical->>buildCommand: buildCommand(seq, abortHistoricalTransmits, body, profile)
    buildCommand-->>cmdAbortHistorical: Profile-specific framed command
    cmdAbortHistorical-->>Labrador: Abort historical transmits command
Loading

Flow diagram for gen4 and gen5 abort command framing

flowchart LR
    A["cmdAbortHistorical(seq)"] --> B{BandProfile}
    B -->|gen4 default| C[4-byte header + crc8]
    B -->|gen5| D[8-byte header + crc16-modbus]
    C --> E[Labrador link]
    D --> E
Loading

File-Level Changes

Change Details Files
Make the historical-transmit abort command select the requested band profile when framing packets.
  • Add an optional profile argument with a gen4 default.
  • Pass the profile through to command framing so gen5 uses its header and CRC format while preserving existing callers.
lib/src/commands.dart
Add regression coverage for profile-aware abort framing and backward compatibility.
  • Verify a gen5 command parses with gen5 framing and fails gen4 validation.
  • Verify the omitted profile continues to produce a valid gen4 command.
test/gen5_command_surface_test.dart

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@abdulsaheel
abdulsaheel merged commit 86e4e1d into main Sep 19, 2026
4 checks passed
abdulsaheel added a commit that referenced this pull request Sep 19, 2026
control.dart already branches on profile.isGen5 to decode this exact
opcode's reply (gen4 u16 deci-percent vs gen5 direct u8 percent), but
the request builder had no way to frame gen5 at all. same fix as
cmdAbortHistorical got in #62.
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