Skip to content

[PM-20957] Update UniFFI to 0.29.1 #256

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

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
Copy link
Contributor

github-actions bot commented Apr 29, 2025

Logo
Checkmarx One – Scan Summary & Details2c2e529f-d394-4318-b172-1a80e7f6ef45

Great job, no security vulnerabilities found in this Pull Request

Copy link

codecov bot commented Apr 29, 2025

Codecov Report

Attention: Patch coverage is 13.46154% with 45 lines in your changes missing coverage. Please review.

Project coverage is 69.61%. Comparing base (90c331a) to head (f543e3b).

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% 11 Missing ⚠️
crates/bitwarden-vault/src/cipher/linked_id.rs 53.84% 6 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.56%   69.61%   +0.05%     
==========================================
  Files         213      218       +5     
  Lines       16644    16617      -27     
==========================================
- Hits        11578    11568      -10     
+ Misses       5066     5049      -17     

☔ 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
Copy link

sonarqubecloud bot commented May 7, 2025

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