Skip to content

feat(network): add opt-in HttpTrafficObserver - #4287

Open
marcoconti83 wants to merge 1 commit into
developfrom
feature/debugger-http-client-config-hook
Open

feat(network): add opt-in HttpTrafficObserver#4287
marcoconti83 wants to merge 1 commit into
developfrom
feature/debugger-http-client-config-hook

Conversation

@marcoconti83

Copy link
Copy Markdown
Member

Internal consumers (e.g. a debugging tool) can now pass an HttpTrafficObserver via KaliumConfigs to see real requests/responses, including bodies and unredacted headers/paths. This is unlike KaliumHttpLogger, which redacts them by design for production log safety.

It's wired through CoreLogic -> UserSessionScope/AuthenticationScope/GlobalKaliumScope into defaultHttpEngine, where it's installed as an OkHttp network interceptor on JVM/Android (no-op on Apple/JS, which don't use OkHttp).

This change is required for Kalium integration with internal debugging tools. For this reason, it's enough to support this on JVM targets.

@github-actions

github-actions Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Test Results

0 tests   - 6 008   0 ✅  - 5 867   0s ⏱️ - 4m 24s
0 suites  -   906   0 💤  -   141 
0 files    -   906   0 ❌ ±    0 

Results for commit c20936d. ± Comparison against base commit 3f2c76c.

♻️ This comment has been updated with latest results.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 1.17647% with 84 lines in your changes missing coverage. Please review.
✅ Project coverage is 61.25%. Comparing base (898e728) to head (452377c).

Files with missing lines Patch % Lines
.../networkContainer/AuthenticatedNetworkContainer.kt 0.00% 40 Missing ⚠️
...etworkContainer/UnauthenticatedNetworkContainer.kt 0.00% 37 Missing ⚠️
...etwork/networkContainer/UnboundNetworkContainer.kt 0.00% 4 Missing ⚠️
...e/kalium/logic/feature/auth/AuthenticationScope.kt 0.00% 2 Missing ⚠️
.../kotlin/com/wire/kalium/logic/GlobalKaliumScope.kt 0.00% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             develop    #4287      +/-   ##
=============================================
- Coverage      61.29%   61.25%   -0.05%     
  Complexity      4018     4018              
=============================================
  Files           2163     2163              
  Lines          69490    69543      +53     
  Branches        6890     6892       +2     
=============================================
+ Hits           42594    42596       +2     
- Misses         24132    24184      +52     
+ Partials        2764     2763       -1     
Files with missing lines Coverage Δ
...om/wire/kalium/logic/featureFlags/KaliumConfigs.kt 100.00% <100.00%> (ø)
.../kotlin/com/wire/kalium/logic/GlobalKaliumScope.kt 0.00% <0.00%> (ø)
...e/kalium/logic/feature/auth/AuthenticationScope.kt 0.00% <0.00%> (ø)
...etwork/networkContainer/UnboundNetworkContainer.kt 0.00% <0.00%> (ø)
...etworkContainer/UnauthenticatedNetworkContainer.kt 2.27% <0.00%> (-0.51%) ⬇️
.../networkContainer/AuthenticatedNetworkContainer.kt 15.45% <0.00%> (-1.94%) ⬇️

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 898e728...452377c. Read the comment docs.

🚀 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.

@github-actions

github-actions Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Branch${GITHUB_HEAD_REF}
Testbedubuntu-latest

⚠️ WARNING: No Threshold found!

Without a Threshold, no Alerts will ever be generated.

Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the --ci-only-thresholds flag.

Click to view all benchmark results
BenchmarkLatencymicroseconds (µs)
com.wire.kalium.benchmarks.logic.CoreLogicBenchmark.createObjectInFiles📈 view plot
⚠️ NO THRESHOLD
881.39 µs
com.wire.kalium.benchmarks.logic.CoreLogicBenchmark.createObjectInMemory📈 view plot
⚠️ NO THRESHOLD
430,774.24 µs
com.wire.kalium.benchmarks.persistence.MessageReadBenchmark.inboxPagingDeepPageBenchmark📈 view plot
⚠️ NO THRESHOLD
129,187.85 µs
com.wire.kalium.benchmarks.persistence.MessageReadBenchmark.inboxPagingFirstPageBenchmark📈 view plot
⚠️ NO THRESHOLD
126,684.65 µs
com.wire.kalium.benchmarks.persistence.MessageReadBenchmark.localMarkAsReadBenchmark📈 view plot
⚠️ NO THRESHOLD
3,324.41 µs
com.wire.kalium.benchmarks.persistence.MessageReadBenchmark.messagePagingDeepPageBenchmark📈 view plot
⚠️ NO THRESHOLD
39,056.76 µs
com.wire.kalium.benchmarks.persistence.MessageReadBenchmark.messagePagingFirstPageBenchmark📈 view plot
⚠️ NO THRESHOLD
23,331.72 µs
com.wire.kalium.benchmarks.persistence.MessagesNoPragmaTuneBenchmark.messageInsertionBenchmark📈 view plot
⚠️ NO THRESHOLD
1,248,020.67 µs
com.wire.kalium.benchmarks.persistence.MessagesNoPragmaTuneBenchmark.queryMessagesBenchmark📈 view plot
⚠️ NO THRESHOLD
20,885.43 µs
🐰 View full continuous benchmarking report in Bencher

@marcoconti83
marcoconti83 force-pushed the feature/debugger-http-client-config-hook branch from 452377c to 9d7d0e9 Compare July 12, 2026 22:41
@sonarqubecloud

Copy link
Copy Markdown

…fic visibility

Consumers (e.g. a debugging tool) can now pass an HttpTrafficObserver via
KaliumConfigs to see real requests/responses, including bodies and
unredacted headers/paths - unlike KaliumHttpLogger, which redacts and never
reads bodies by design for production log safety. Wired through
CoreLogic -> UserSessionScope/AuthenticationScope/GlobalKaliumScope into
defaultHttpEngine, where it's installed as an OkHttp network interceptor
on JVM/Android (no-op on Apple/JS, which don't use OkHttp).
@marcoconti83
marcoconti83 force-pushed the feature/debugger-http-client-config-hook branch from 9d7d0e9 to c20936d Compare July 16, 2026 16:08
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