Skip to content

Conversation

@sirzooro
Copy link
Contributor

@sirzooro sirzooro commented Jan 9, 2026

Updated interceptor configuration functions to support options. Added options to configure logger factory and interceptor-specific options. Updated NewAPI to pass LoggerFactory when default interceptors are registered.

@codecov
Copy link

codecov bot commented Jan 9, 2026

Codecov Report

❌ Patch coverage is 80.00000% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.99%. Comparing base (4a5fbf4) to head (acc07d2).

Files with missing lines Patch % Lines
interceptor.go 69.04% 10 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3355      +/-   ##
==========================================
- Coverage   85.02%   84.99%   -0.03%     
==========================================
  Files          80       81       +1     
  Lines        9534     9584      +50     
==========================================
+ Hits         8106     8146      +40     
- Misses       1003     1014      +11     
+ Partials      425      424       -1     
Flag Coverage Δ
go 84.99% <80.00%> (-0.03%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request enhances the interceptor configuration API by adding an options pattern to support configurable LoggerFactory and interceptor-specific options. The primary motivation is to enable NewAPI to pass its LoggerFactory to default interceptors when they are registered.

Key changes:

  • Added new InterceptorOptions struct and option functions to configure interceptors
  • Created *WithOptions variants of existing configuration functions for backward compatibility
  • Updated NewAPI to pass LoggerFactory when auto-registering default interceptors

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
interceptor_option.go New file defining InterceptorOptions and option setter functions
interceptor.go Added WithOptions variants for interceptor configuration, fixed typo "reciver" → "receiver", improved variable naming, added documentation comments
api.go Updated to use RegisterDefaultInterceptorsWithOptions with LoggerFactory
interceptor_test.go Updated test to use new WithOptions API (contains unprofessional comment)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sirzooro sirzooro requested a review from JoTurk January 9, 2026 17:29
Copy link
Member

@JoTurk JoTurk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wish we could do this without introducing this many public APIs in webrtc, but ig we have to.

)

// InterceptorOptions contains options for configuring interceptors.
type InterceptorOptions struct {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to be public?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, changed

Updated interceptor configuration functions to support options. Added
options to configure logger factory and interceptor-specific options.
Updated NewAPI to pass LoggerFactory when default interceptors are
registered.
@sirzooro sirzooro force-pushed the interceptors_loggerfactory branch from d994454 to acc07d2 Compare January 10, 2026 19:25
@sirzooro
Copy link
Contributor Author

Wish we could do this without introducing this many public APIs in webrtc, but ig we have to.

I do not like it too, unfortunately there was no other easy way to inject LoggerFactory. This is another thing to cleanup in the future when webrtc v5 will be released.

@sirzooro sirzooro requested a review from JoTurk January 12, 2026 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants