Skip to content

Conversation

@saleniuk
Copy link
Contributor

@saleniuk saleniuk commented Jan 2, 2026

StoryWPB-21930 [Android] Cleanup logged values


PR Submission Checklist for internal contributors

  • The PR Title

    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like SQPIT-764
    • answers the question: If merged, this PR will: ... ³
  • The PR Description

    • is free of optional paragraphs and you have filled the relevant parts to the best of your ability

What's new in this PR?

Issues

There are no headers in the http responses logs even if the headers are allowed for the selected log level.

Causes (Optional)

The expression when was used unnecessarily, causing log types to be mutually exclusive when they shouldn't. There are log levels where multiple log types can be enabled - for example, LogLevel. ALL, which has all three types enabled: info, headers, and body or LogLevel.HEADERS which has both info and headers enabled, but by using when, it was only possible to display logs of one type, so either info or headers or body, but it was not possible to combine them unless the types had the same code duplicated.

Solutions

Use if instead of when to determine whether given log type can be used or not and apply corresponding logs if the given log type is available. This fixes the issue for missing headers in the response logs in case of a log level that has both info and headers enabled. Thanks to that, it's also possible to simplify the code for request logs and remove duplicated code applied to all three log types.

Testing

How to Test

Have logging enabled in app (so the log level is ALL) and check logs for the http responses - should contain headers just like requests logs.


PR Post Submission Checklist for internal contributors (Optional)

  • Wire's Github Workflow has automatically linked the PR to a JIRA issue

PR Post Merge Checklist for internal contributors

  • If any soft of configuration variable was introduced by this PR, it has been added to the relevant documents and the CI jobs have been updated.

References
  1. https://sparkbox.com/foundry/semantic_commit_messages
  2. https://github.com/wireapp/.github#usage
  3. E.g. feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 2, 2026

@github-actions
Copy link
Contributor

github-actions bot commented Jan 2, 2026

Test Results

0 tests   - 4 271   0 ✅  - 4 158   0s ⏱️ - 5m 58s
0 suites  -   717   0 💤  -   113 
0 files    -   717   0 ❌ ±    0 

Results for commit b0303d8. ± Comparison against base commit 628222c.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 2, 2026

🐰 Bencher Report

Branchfix/http-logs-response-headers
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
683.86 µs
com.wire.kalium.benchmarks.logic.CoreLogicBenchmark.createObjectInMemory📈 view plot
⚠️ NO THRESHOLD
480,601.73 µs
com.wire.kalium.benchmarks.persistence.MessagesNoPragmaTuneBenchmark.messageInsertionBenchmark📈 view plot
⚠️ NO THRESHOLD
1,349,091.97 µs
com.wire.kalium.benchmarks.persistence.MessagesNoPragmaTuneBenchmark.queryMessagesBenchmark📈 view plot
⚠️ NO THRESHOLD
21,125.19 µs
🐰 View full continuous benchmarking report in Bencher

@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 0% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.05%. Comparing base (628222c) to head (b0303d8).

Files with missing lines Patch % Lines
...kotlin/com/wire/kalium/network/KaliumHttpLogger.kt 0.00% 11 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3795      +/-   ##
===========================================
+ Coverage    60.04%   60.05%   +0.01%     
===========================================
  Files         1823     1823              
  Lines        58046    58033      -13     
  Branches      6318     6313       -5     
===========================================
- Hits         34852    34851       -1     
+ Misses       20325    20312      -13     
- Partials      2869     2870       +1     
Files with missing lines Coverage Δ
...kotlin/com/wire/kalium/network/KaliumHttpLogger.kt 0.00% <0.00%> (ø)

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 628222c...b0303d8. 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.

@saleniuk saleniuk requested a review from ohassine January 7, 2026 09:24
@saleniuk saleniuk requested a review from yamilmedina January 15, 2026 08:59
@yamilmedina yamilmedina added this pull request to the merge queue Jan 15, 2026
Merged via the queue into develop with commit 9aa9607 Jan 15, 2026
30 checks passed
@yamilmedina yamilmedina deleted the fix/http-logs-response-headers branch January 15, 2026 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants