Skip to content

Conversation

@dani-garcia
Copy link
Member

@dani-garcia dani-garcia commented Apr 29, 2025

🎟️ Tracking

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

📔 Objective

This replaces the renovate PR as the changes are fairly big.

Update UniFFI to version 0.29.1. This requires bumping MSRV to 1.82, as that's the requirement from UniFFI.

The migration consists of a few parts:

  • Replaced all the uses of UniffiCustomTypeConverter by the simpler custom_type! macro. Note that for types defined in other crates, we still use the same macro, but with the remote, value added.
  • Reworked all the uses of ffi_converter_forward!:
    • If they were forwarding bitwarden defined types, they aren't needed anymore.
    • If they were forwarding types from third party crates, they were replaced by use_remote_type!
  • Replaced a usage of uniffi::deps::log by the log crate directly.
  • While replacing the implementation of LinkedId, I've noticed that we had two implementations of TryFrom<U32>, the one used by uniffi based on deserialize, and a hardcoded map. I've combined them in one using the deserialize strategy.

I've tested this on the Android and iOS native apps, and they both compile and decrypt the vault without issues.

⏰ 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

@dani-garcia dani-garcia changed the title Update UniFFI to 0.29.1 [PM-20957] Update UniFFI to 0.29.1 Apr 29, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Apr 29, 2025

Logo
Checkmarx One – Scan Summary & Detailsb23f100e-4c5a-4486-ad37-d4cd78a3dfb3

Great job, no security vulnerabilities found in this Pull Request

@codecov
Copy link

codecov bot commented Apr 29, 2025

Codecov Report

Attention: Patch coverage is 16.66667% with 35 lines in your changes missing coverage. Please review.

Project coverage is 69.95%. Comparing base (91e3e2a) to head (a85b1c9).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
crates/bitwarden-crypto/src/uniffi_support.rs 0.00% 19 Missing ⚠️
crates/bitwarden-core/src/uniffi_support.rs 0.00% 7 Missing ⚠️
crates/bitwarden-send/src/uniffi_support.rs 0.00% 2 Missing ⚠️
crates/bitwarden-uniffi/src/uniffi_support.rs 0.00% 2 Missing ⚠️
crates/bitwarden-vault/src/uniffi_support.rs 0.00% 2 Missing ⚠️
crates/bitwarden-exporters/src/uniffi_support.rs 0.00% 1 Missing ⚠️
crates/bitwarden-fido/src/uniffi_support.rs 0.00% 1 Missing ⚠️
crates/bitwarden-uniffi/src/lib.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #256      +/-   ##
==========================================
+ Coverage   69.93%   69.95%   +0.01%     
==========================================
  Files         214      219       +5     
  Lines       16989    16953      -36     
==========================================
- Hits        11882    11860      -22     
+ Misses       5107     5093      -14     

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

@dani-garcia dani-garcia marked this pull request as ready for review April 29, 2025 13:12
@dani-garcia dani-garcia requested a review from a team as a code owner April 29, 2025 13:12
Hinton
Hinton previously approved these changes May 1, 2025
Copy link
Contributor

@coroiu coroiu left a comment

Choose a reason for hiding this comment

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

Looks good, just some small simplification comments

@sonarqubecloud
Copy link

@dani-garcia dani-garcia requested a review from coroiu May 23, 2025 12:48
Copy link
Contributor

@coroiu coroiu left a comment

Choose a reason for hiding this comment

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

Let's goooooo

Copy link
Contributor

@coroiu coroiu left a comment

Choose a reason for hiding this comment

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

Second time's the charm

@dani-garcia dani-garcia merged commit 82595fe into main May 23, 2025
44 checks passed
@dani-garcia dani-garcia deleted the ps/update-uniffi branch May 23, 2025 13:56
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.

4 participants