Skip to content

Conversation

@quexten
Copy link
Contributor

@quexten quexten commented Nov 12, 2025

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-28135

📔 Objective

Enables tracing, but does not yet remove the old logging (follow-up). It adds tracing to the most important crypto paths. Follow-up tickets may add more tracing.

Example log output:

ERROR log{cipher_id=Some(CipherId(18c99ec6-af2b-407a-a5d0-b39201386413))}:decrypt: bitwarden_crypto::traits::decryptable: Function returned error error=The cipher's MAC doesn't match the expected value

__wbg_error_a7f8fbb0523dae15 @ bitwarden_wasm_internal_bg.js:4508
$func7041 @ 43dc2d8abaf76eb338eb.module.wasm:0x2c3395
$func3785 @ 43dc2d8abaf76eb338eb.module.wasm:0x297ed0
$func232 @ 43dc2d8abaf76eb338eb.module.wasm:0xa3c75
$func6915 @ 43dc2d8abaf76eb338eb.module.wasm:0x2c23e3
$func2456 @ 43dc2d8abaf76eb338eb.module.wasm:0x2687b1
$func817 @ 43dc2d8abaf76eb338eb.module.wasm:0x1b8e06
$func192 @ 43dc2d8abaf76eb338eb.module.wasm:0x5ce74
$func2995 @ 43dc2d8abaf76eb338eb.module.wasm:0x27f181
...

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation
    team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed
    issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

@quexten quexten changed the title Km/tracing Add crypto tracing logs Nov 12, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Nov 12, 2025

Logo
Checkmarx One – Scan Summary & Details6bdc4070-bbfa-4202-b5fd-bdbe5a592a15

Great job! No new security vulnerabilities introduced in this pull request

@quexten quexten changed the title Add crypto tracing logs [POC] Add crypto tracing logs Nov 12, 2025
@codecov
Copy link

codecov bot commented Nov 12, 2025

Codecov Report

❌ Patch coverage is 66.66667% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.66%. Comparing base (5c178be) to head (703b4ea).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
crates/bitwarden-core/src/key_management/crypto.rs 66.66% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #555      +/-   ##
==========================================
- Coverage   79.74%   79.66%   -0.08%     
==========================================
  Files         304      304              
  Lines       32757    32644     -113     
==========================================
- Hits        26121    26006     -115     
- Misses       6636     6638       +2     

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

@quexten quexten changed the title [POC] Add crypto tracing logs [POC|PM-28135] Add crypto tracing logs Nov 13, 2025
@quexten quexten marked this pull request as ready for review November 13, 2025 14:36
@quexten quexten requested review from a team as code owners November 13, 2025 14:36
@quexten
Copy link
Contributor Author

quexten commented Nov 17, 2025

@Hinton Okay, I've not further benchmarked it since I agree that it's most likely negligible. I've set the max log level to release_max_level_info, since I don't think anyone would expect trace / debug to be emitted in release.

In case we do want logging in an operation that gets called millions of times, we should consider using debug/trace to have it compiled out in release.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 17, 2025

🔍 SDK Breaking Change Detection Results

SDK Version: km/tracing (703b4ea)
Completed: 2025-12-08 15:44:17 UTC
Total Time: 216s

Client Status Details
typescript ✅ No breaking changes detected TypeScript compilation passed with new SDK version - View Details

Breaking change detection completed. View SDK workflow

@quexten quexten marked this pull request as draft December 1, 2025 17:07
@quexten quexten marked this pull request as ready for review December 2, 2025 13:51
mzieniukbw
mzieniukbw previously approved these changes Dec 3, 2025
@quexten quexten changed the title [POC|PM-28135] Add crypto tracing logs [PM-28135] Add crypto tracing logs Dec 8, 2025
coroiu
coroiu previously approved these changes Dec 8, 2025
Jingo88
Jingo88 previously approved these changes Dec 8, 2025
@quexten quexten dismissed stale reviews from Jingo88 and coroiu via 3d2367a December 8, 2025 15:33
@quexten
Copy link
Contributor Author

quexten commented Dec 8, 2025

Apologies, had to fix another clippy error

@quexten quexten enabled auto-merge (squash) December 10, 2025 13:02
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.

7 participants