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

bacnet-js / client / 23839569494
85%

Build:
DEFAULT BRANCH: master
Ran 01 Apr 2026 08:35AM 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

01 Apr 2026 08:32AM UTC coverage: 85.276% (+0.1%) from 85.142%
23839569494

push

github

web-flow
fix: decode special log records in ReadRange without status flags (#77)

Fixes ReadRange decoding when TREND_LOG contains special log records
(e.g., `log-interrupted`, `time-change`) that don't have status flags.

## Problem

When reading a `TREND_LOG` that contains a special log record, records
after it were silently missing from the result. The issue was that
`decodeRange` unconditionally consumed the status flags bytes after the
log-datum value, but special records don't have status flags. This
caused the decoder to read into the bytes of the next record and lose
sync.

## Solution

Updated `decodeRange` in `src/lib/asn1.ts` to:
- Validate closing tag 1 before consuming it
- Check for context tag 2 presence before decoding status flags (status
flags are **optional for ALL record types** per ASHRAE 135 §12.25)
- Add support for log-status choice (context tag 0 - special records
like `log-disabled`, `buffer-purged`, `log-interrupted`)
- Add support for time-change choice (context tag 9 - clock adjustment
records)
- Add `isLogStatus`, `logStatus`, and `isTimeChange` fields to
differentiate special records

## Type Changes

- Extracted `LogRecord`, `LogStatusFlags`, `LogRecordStatusFlags`
interfaces to `types.ts`
- Updated `ReadRangeAcknowledge.values` to use `LogRecord[]` instead of
`any[]`
- Added `LogRecordValue` union type to narrow `LogRecord.value`
- Added ASHRAE 135 §12.25 standard references to code comments

## Testing

- Added unit test for special log-status records without status flags
(mixed with normal records)
- Added unit test for time-change records without status flags
- All 204 unit tests pass
- Linting passes
- Build passes
- CodeQL security scan - no issues found

<!-- START COPILOT ORIGINAL PROMPT -->



<details>

<summary>Original prompt</summary>

> 
> ----
> 
> *This section details on the original issue you should resolve*
> 
> <issue_title>ReadRange bug when response contains a special log
record</issue_title>
> <issue_descr... (continued)

1053 of 1546 branches covered (68.11%)

Branch coverage included in aggregate %.

31 of 32 new or added lines in 2 files covered. (96.88%)

2 existing lines in 1 file now uncovered.

5590 of 6244 relevant lines covered (89.53%)

37.82 hits per line

Uncovered Changes

Lines Coverage ∆ File
1
70.38
0.75% src/lib/asn1.ts

Coverage Regressions

Lines Coverage ∆ File
2
70.38
0.75% src/lib/asn1.ts
Jobs
ID Job ID Ran Files Coverage
1 23839569494.1 01 Apr 2026 08:35AM UTC 44
85.28
GitHub Action Run
Source Files on build 23839569494
  • Tree
  • List 44
  • Changed 4
  • Source Changed 3
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #23839569494
  • 8074b543 on github
  • Prev Build on master (#22664539794)
  • Next Build on master (#23839642556)
  • 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