Skip to content

fix(tagxl): gate port 151 reset reason feature#194

Merged
michaelbeutler merged 2 commits into
mainfrom
fix/tagxl-port151-reset-null
Jun 30, 2026
Merged

fix(tagxl): gate port 151 reset reason feature#194
michaelbeutler merged 2 commits into
mainfrom
fix/tagxl-port151-reset-null

Conversation

@niko-kriznik-globtim

@niko-kriznik-globtim niko-kriznik-globtim commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Only exposes Tag XL port 151 reset reason when TLV 0x4a decodes to a meaningful reset cause.
  • Keeps PIN/watchdog/etc. reset causes working while suppressing absent, zero, and VREGIN-only causes.
  • Adds regression coverage for absent and unknown reset causes.

Test plan

  • go test ./pkg/decoder/tagxl/v1/... -run 'Port151|Reset'
  • go test ./...

Refs truvami/bridge#234

Summary by CodeRabbit

  • Bug Fixes
    • Improved reset-reason handling for TAG XL v1 messages on port 151.
    • Known reset reasons are reflected as before, while unknown reset reasons no longer produce a misleading reset-reason feature in decoded output.
  • Tests
    • Strengthened port 151 reset-reason validation with table-driven cases covering multiple outcomes.
  • Chores
    • Updated the CI lint action version.

Only advertise reset reason when the decoded reset cause is meaningful, preventing settings payloads with null or unknown causes from downstream reset events.
@niko-kriznik-globtim

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 85bd9f66-1264-4afc-b33e-3975ac35cd42

📥 Commits

Reviewing files that changed from the base of the PR and between da47fbf and 5e4f244.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml

📝 Walkthrough

Walkthrough

TAG XL v1 port 151 now includes FeatureResetReason only when decoding yields a known reset reason. The port config and tests were updated accordingly, and the CI lint action version was bumped.

Changes

Port 151 ResetReason Dynamic Feature Filtering

Layer / File(s) Summary
Port 151 config and unknown-reason feature removal
pkg/decoder/tagxl/v1/decoder.go
ResetCause is tied to decoder.FeatureResetReason, FeatureResetReason is removed from the static Features list, slices is imported, and post-decode logic strips FeatureResetReason when the reset reason is ResetReasonUnknown.
Table-driven reset reason tests
pkg/decoder/tagxl/v1/decoder_test.go
TestPort151ResetReasonFromDecode is rewritten as a table-driven test covering multiple payloads, asserting FeatureResetReason presence and GetResetReason() values.

CI Lint Action Update

Layer / File(s) Summary
Lint action version bump
.github/workflows/ci.yml
The lint job updates golangci/golangci-lint-action from v2.1 to v2.10.1.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • truvami/decoder#187: Updates the same TAG XL v1 port 151 reset-cause decode path and FeatureResetReason handling.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Clear and specific: it matches the main change to gate Tag XL port 151 reset reason exposure.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/tagxl-port151-reset-null

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

@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 30, 2026
@niko-kriznik-globtim niko-kriznik-globtim marked this pull request as ready for review June 30, 2026 10:35
michaelbeutler
michaelbeutler previously approved these changes Jun 30, 2026
@michaelbeutler

Copy link
Copy Markdown
Contributor

@niko-kriznik-globtim please fix CI

Use a newer golangci-lint patch that passes locally and avoids the CI action failure seen with the older v2.1 pin.
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Files with missing lines Coverage Δ
pkg/decoder/tagxl/v1/decoder.go 91.21% <100.00%> (+0.06%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@michaelbeutler michaelbeutler merged commit edb2290 into main Jun 30, 2026
8 checks passed
@michaelbeutler michaelbeutler deleted the fix/tagxl-port151-reset-null branch June 30, 2026 11:00
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.

3 participants