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

coapjs / node-coap / 8433889529
90%

Build:
DEFAULT BRANCH: master
Ran 26 Mar 2024 09:45AM UTC
Jobs 2
Files 15
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

26 Mar 2024 09:44AM UTC coverage: 91.747% (-0.05%) from 91.798%
8433889529

push

github

web-flow
Fix blockwise response logic (#376)

* Update blockwise tests to catch edge-cases

Updates the blockwise tests to catch the cases where the payload is
smaller than 'maxPacket', but the overall packet size after the headers
are added exceeds 'maxPacket' which causes an error to be thrown.

Also adds checks to ensure that the response code is 2.05 for the tests
that require it, so 5.00 errors can't sneak through.

* Update automatic blockwise transfer logic

Fix for blockwise transfer issues raised in #373 where a coap message
could avoid being split into blocks, yet still be larger than the
allowable size of 1280 bytes. This applies the recommended maximum
payload size from RFC 7252 Section 4.6 of 1024 bytes, and allows it to
be reduced in the config parameters as required.

The error that this fixes was introduced in
d727d430d and this attempts to keep the
intent behind that commit, whilst fixing the technical flaws that it
introduced.

The 'IP_MTU' constant has been renamed to 'MAX_PAYLOAD' to more
accurately describe what the it represents. The 'maxPacketSize'
parameter has also been renamed to 'maxPayloadSize' for the same
reason.

Note that the renaming of the parameter is a potentially breaking
change.

* Perform extra checks on CoAP message size

This fixes the logic for checking the maximum CoAP message size. The
check is actually performed in the coap-packet repository in a default
parameter on the `generate()` function, however the default value is not
appropriate for all (if any) cases.

The maximum size that a CoAP message can be is the IP MTU, minus the IP
header and  minus the UDP header. The value is not constant across all
IP network stacks, so the CoAP specification recommends a maximum of 1152
bytes for cases where it is not known. The only way to know for sure is
MTU path discovery, which is way outside of the scope of the project.

This commit creates a parame... (continued)

547 of 641 branches covered (85.34%)

Branch coverage included in aggregate %.

29 of 34 new or added lines in 2 files covered. (85.29%)

1 existing line in 1 file now uncovered.

2888 of 3103 relevant lines covered (93.07%)

2290.47 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
5
86.61
-0.25% lib/server.ts

Uncovered Existing Lines

Lines Coverage ∆ File
1
86.61
-0.25% lib/server.ts
Jobs
ID Job ID Ran Files Coverage
1 8433889529.1 26 Mar 2024 09:45AM UTC 15
91.67
GitHub Action Run
2 8433889529.2 26 Mar 2024 09:46AM UTC 15
91.75
GitHub Action Run
Source Files on build 8433889529
  • Tree
  • List 15
  • Changed 10
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • 2dbe4da1 on github
  • Prev Build on master (#8433483634)
  • Next Build on master (#9363797542)
  • 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