Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: upgrade dependencies to their latest versions #373

Merged
merged 2 commits into from
Nov 24, 2023

Conversation

JKRhb
Copy link
Member

@JKRhb JKRhb commented Nov 19, 2023

This PR updates all dependencies except readable-stream and sinon. Especially the latter one needs some more special treatment to keep working.

Copy link

Pull Request Test Coverage Report for Build 6946023196

  • 8 of 8 (100.0%) changed or added relevant lines in 1 file are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.06%) to 91.815%

Files with Coverage Reduction New Missed Lines %
lib/server.ts 2 87.0%
Totals Coverage Status
Change from base Build 6942734405: -0.06%
Covered Lines: 2859
Relevant Lines: 3072

💛 - Coveralls

Copy link

github-actions bot commented Nov 21, 2023

Pull Request Test Coverage Report for Build 6946023196

  • 8 of 8 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 91.871%

Totals Coverage Status
Change from base Build 6942734405: 0.0%
Covered Lines: 2861
Relevant Lines: 3072

💛 - Coveralls

@JKRhb JKRhb marked this pull request as ready for review November 21, 2023 15:38
@JKRhb JKRhb requested a review from Apollon77 November 21, 2023 15:38
index.ts Outdated Show resolved Hide resolved
test/server.ts Outdated Show resolved Hide resolved
Copy link

github-actions bot commented Nov 24, 2023

Pull Request Test Coverage Report for Build 6980298525

  • 8 of 8 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 91.871%

Totals Coverage Status
Change from base Build 6942734405: 0.0%
Covered Lines: 2861
Relevant Lines: 3072

💛 - Coveralls

@Apollon77
Copy link
Collaborator

Approved, merge wehen you are ready

@JKRhb
Copy link
Member Author

JKRhb commented Nov 24, 2023

Approved, merge wehen you are ready

Awesome, thank you :)

@JKRhb JKRhb enabled auto-merge November 24, 2023 11:44
@JKRhb JKRhb merged commit 5014206 into master Nov 24, 2023
7 checks passed
@JKRhb JKRhb deleted the upgrade-dependencies branch November 24, 2023 11:55
edrose added a commit to edrose/node-coap that referenced this pull request Dec 16, 2023
Fix for blockwise transfer issues raised in coapjs#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 '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 'maxPayload' size for the same
reason.

Note that the renaming of the parameter is a potentially breaking
change.
edrose added a commit to edrose/node-coap that referenced this pull request Dec 16, 2023
Fix for blockwise transfer issues raised in coapjs#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
d727d43 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.
edrose added a commit to edrose/node-coap that referenced this pull request Dec 17, 2023
Fix for blockwise transfer issues raised in coapjs#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
d727d43 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.
edrose added a commit to edrose/node-coap that referenced this pull request Dec 17, 2023
Fix for blockwise transfer issues raised in coapjs#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
d727d43 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.
edrose added a commit to edrose/node-coap that referenced this pull request Dec 17, 2023
Fix for blockwise transfer issues raised in coapjs#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
d727d43 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.
Apollon77 pushed a commit that referenced this pull request Mar 26, 2024
* 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
d727d43 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 parameter that allows the max packet size to be
adjusted as a server parameter for cases where (for example) the server
is running on a 6LoWPAN/Thread network and needs a lower maximum message
size.

Note that the logic for enforcing the size is just to throw an error and
crash the server. However, since the maximum payload size is enforced a
situation like that should never occur.
JimmyBjorklund pushed a commit to JimmyBjorklund/node-coap that referenced this pull request May 28, 2024
* 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 coapjs#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
d727d43 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 parameter that allows the max packet size to be
adjusted as a server parameter for cases where (for example) the server
is running on a 6LoWPAN/Thread network and needs a lower maximum message
size.

Note that the logic for enforcing the size is just to throw an error and
crash the server. However, since the maximum payload size is enforced a
situation like that should never occur.
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.

2 participants