• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

bacnet-js / client / 22217025805
85%

Build:
DEFAULT BRANCH: master
Ran 20 Feb 2026 08:34AM UTC
Jobs 1
Files 44
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

20 Feb 2026 08:31AM UTC coverage: 84.309% (+1.4%) from 82.951%
22217025805

push

github

web-flow
fix(asn1): preserve raw date bytes for wildcard/partial date decode (#70)

## Summary
This PR fixes BACnet DATE wildcard handling by preserving raw DATE
fields during decode.

I initially suspected the bug was in the encoder, but investigation
showed the write payload was encoded correctly.
The actual issue was in decode/normalization, where partial wildcard
DATE values were being normalized through JS `Date`, causing readback
drift/misinterpretation.

## Root Cause
- Wildcard/partial DATE values (e.g. `17.*.*.*`, `*.*.*.Fri`, `28.*.2021
-> 30.*.2032`) were valid on write.
- On read, decoder/normalization converted these to JS `Date` semantics,
which cannot represent BACnet wildcard bytes faithfully.
- This produced incorrect values when rendering/roundtripping.

## Changes
- Preserve raw DATE byte components (`year`, `month`, `day`, `wday`)
from decoder output.
- Avoid JS Date normalization for wildcard/partial DATE patterns.
- Ensure downstream consumers can prefer `raw` when reconstructing
BACnet DATE patterns.

## Impact
- Fixes incorrect readback of wildcard/partial DATE values.
- Restores roundtrip consistency for scheduler/calendar exception
use-cases.
- No behavior change for fully specified dates.

## Validation
Tested with real-device and gateway flows, including:
- Single date wildcard patterns (`17.*.*.*`, `*.*.*.Friday`, `*.*.*.*`)
- Date range with partial wildcards (`28.*.2021 -> 30.*.2032`)
- Verified write succeeds where device allows pattern
- Verified readback now matches original BACnet wildcard intent

## Compatibility
Backward compatible.
No API break; change is in decode fidelity and normalization behavior.

---------

Co-authored-by: Daniel Lando <daniel.sorridi@gmail.com>

904 of 1381 branches covered (65.46%)

Branch coverage included in aggregate %.

14 of 14 new or added lines in 1 file covered. (100.0%)

121 existing lines in 1 file now uncovered.

5259 of 5929 relevant lines covered (88.7%)

37.24 hits per line

Uncovered Existing Lines

Lines Coverage ∆ File
121
65.29
0.63% src/lib/client.ts
Jobs
ID Job ID Ran Files Coverage
1 22217025805.1 20 Feb 2026 08:34AM UTC 44
84.31
GitHub Action Run
Source Files on build 22217025805
  • Tree
  • List 44
  • Changed 5
  • Source Changed 4
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #22217025805
  • 29f2f8fa on github
  • Prev Build on master (#22172650479)
  • Next Build on master (#22630477444)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc