Skip to content

fix(tagxl): decode port 10 movement - #205

Merged
michaelbeutler merged 1 commit into
mainfrom
fix/loros-port10-moving
Sep 8, 2026
Merged

michaelbeutler merged 1 commit into
mainfrom
fix/loros-port10-moving

Conversation

@niko-kriznik-globtim

@niko-kriznik-globtim niko-kriznik-globtim commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Loros port 10 GNSS uplinks encode movement in bit 0 of the status byte (firmware commit 45b8a05e). The shared Tag XL decoder kept that byte as opaque Status and did not advertise FeatureMoving, so bridge stored Position.Moving as nil and the dashboard rendered it as N/A.

This maps the same byte to Moving and advertises FeatureMoving. Downstream code already consumes that feature; no protobuf, API, or dashboard change is required.

Status stays on the payload for compatibility. Firmware that still writes 00 now reports false rather than unknown. There is no payload version that can recover the previous unknown state.

Tag XL, Smart Label v2, and Loros share this decoder. All three now expose the same bit-0 movement flag on port 10.

Closes #203

Test plan

  • go test ./pkg/decoder/tagxl/v1/
  • go test ./...
  • go vet ./...
  • golangci-lint run ./...
  • make check-json-tags check-metrics
  • pre-commit run --all-files on the changed files
  • Fixtures: status 00Moving=false, 01true, 02false (bit 0 only)

No database queries or migrations were run.

Summary by CodeRabbit

  • New Features
    • TagXL port 10 payloads now report whether the device is moving.
    • Movement status is available alongside GNSS, timestamp, and battery information.
    • Movement state is included in serialized payload output.

Map status bit 0 to FeatureMoving so Loros GNSS uplinks
carry a present moving flag instead of unknown.
@niko-kriznik-globtim

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 8, 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: ac43e406-3739-4fe5-bb8f-547009724c28

📥 Commits

Reviewing files that changed from the base of the PR and between 16ace1c and 76aba3c.

📒 Files selected for processing (5)
  • .secrets.baseline
  • pkg/decoder/tagxl/v1/decoder.go
  • pkg/decoder/tagxl/v1/decoder_test.go
  • pkg/decoder/tagxl/v1/port10.go
  • pkg/decoder/tagxl/v1/port10_test.go

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


📝 Walkthrough

Walkthrough

Port 10 GNSS payloads now decode and serialize movement state. The payload implements decoder.UplinkFeatureMoving, and tests cover stationary and moving values. The secrets baseline was regenerated for the updated test file.

Changes

Port 10 moving support

Layer / File(s) Summary
Moving state contract
pkg/decoder/tagxl/v1/port10.go, pkg/decoder/tagxl/v1/port10_test.go
Port10Payload adds the Moving field and IsMoving() method. Tests cover both movement states.
Decoder integration and validation
pkg/decoder/tagxl/v1/decoder.go, pkg/decoder/tagxl/v1/decoder_test.go
Port 10 reads movement from byte 0, advertises FeatureMoving, and validates decode and marshal output.
Secrets baseline regeneration
.secrets.baseline
The baseline records two new findings and updated test-file line numbers.

Priority: ➖ Normal — Impact reflects medium issue severity.

Estimated code review effort: 2 (Simple) | ~10 minutes

Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 76aba

Port 10 GNSS uplinks now provide a boolean movement state to downstream consumers while preserving the existing status field. The decoding and serialized behavior are covered for stationary and moving payloads, with no remaining concrete merge-blocking risk.

Suggested reviewers: michaelbeutler

🚥 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%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 4 files. (1 skipped: 1 … 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 The title clearly and concisely describes the main change: decoding the port 10 movement flag for Tag XL.
Linked Issues check ✅ Passed The changes address issue #203 by decoding bit 0 of the port 10 status byte, exposing decoder.FeatureMoving, implementing IsMoving(), and adding coverage for stationary and moving payloads. These chan…
Out of Scope Changes check ✅ Passed The changes remain within scope. The decoder update, public movement interface implementation, tests, and regenerated secrets baseline all support the port 10 movement decoding change. No unrelated pr…
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 4 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/loros-port10-moving

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

@coderabbitai

coderabbitai Bot commented Sep 8, 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.

@niko-kriznik-globtim
niko-kriznik-globtim marked this pull request as ready for review September 8, 2026 07:53
@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.50% <100.00%> (+0.01%) ⬆️
pkg/decoder/tagxl/v1/port10.go 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

🚀 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 527315c into main Sep 8, 2026
8 checks passed
@niko-kriznik-globtim
niko-kriznik-globtim deleted the fix/loros-port10-moving branch September 8, 2026 08:06
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.

Moving flag for port 10 in Loros showing as "N/A" in the dashboard

3 participants