rtcp icon indicating copy to clipboard operation
rtcp copied to clipboard

Wrap short-packet errors with packet context

Open debugmenot opened this issue 3 months ago • 1 comments

Description

  1. wrap all code paths that return errPacketTooShort so the error message now includes the packet or header type while keeping errors.Is compatibility

  2. add helper utilities (packetTooShortError, packetNameFromHeader) to centralize naming logic. packetNameFromHeader can be used later to fine-tune other errors with their origin

  3. update existing unmarshallers and size checks to use the helper, improving observability across RTCP packet types

  4. extend the test suite to cover the new behavior, including unit tests for the helper and a regression test on the existing invalid-header scenario

Reference issue

#Implements improvement pion/rtcp#208

debugmenot avatar Oct 29 '25 16:10 debugmenot

Codecov Report

:x: Patch coverage is 59.79381% with 39 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 77.03%. Comparing base (99b388f) to head (bd3c40c).

Files with missing lines Patch % Lines
packet.go 41.46% 24 Missing :warning:
errors.go 79.16% 3 Missing and 2 partials :warning:
transport_layer_cc.go 33.33% 4 Missing :warning:
receiver_estimated_maximum_bitrate.go 0.00% 3 Missing :warning:
full_intra_request.go 50.00% 1 Missing :warning:
rfc8888.go 0.00% 1 Missing :warning:
source_description.go 75.00% 1 Missing :warning:

:x: Your patch check has failed because the patch coverage (59.79%) is below the target coverage (70.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #211      +/-   ##
==========================================
- Coverage   77.07%   77.03%   -0.04%     
==========================================
  Files          22       23       +1     
  Lines        2569     2086     -483     
==========================================
- Hits         1980     1607     -373     
+ Misses        493      381     -112     
- Partials       96       98       +2     
Flag Coverage Δ
go 77.03% <59.79%> (-0.04%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar Oct 29 '25 16:10 codecov[bot]