-
Notifications
You must be signed in to change notification settings - Fork 14
UniFFI don't panic on failed lift #373
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
base: main
Are you sure you want to change the base?
Conversation
Great job! No new security vulnerabilities introduced in this pull request |
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #373 +/- ##
==========================================
- Coverage 73.95% 73.79% -0.16%
==========================================
Files 252 253 +1
Lines 21574 21595 +21
==========================================
- Hits 15955 15937 -18
- Misses 5619 5658 +39 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good from the KM perspective.
|
||
pub use anyhow::Error; | ||
|
||
/// Configure an error converter to conver errors in calls to [`uniffi::custom_type!`] into the main |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// Configure an error converter to conver errors in calls to [`uniffi::custom_type!`] into the main | |
/// Configure an error converter to convert errors in calls to [`uniffi::custom_type!`] into the main |
🎟️ Tracking
📔 Objective
UniFFI uses the
custom_type!
macro to convert request/response types. The request conversion is allowed to fail which should produce an error in the apps, but there are cases where it would produce a panic instead. The cases are:custom_type!
, then UniFFI produces a panic.One way to fix this is to have the
custom_type!
calls returnbitwarden_uniffi::error::BitwardenError
, but this isn't possible as core and crypto can't depend on uniffi due to circular dependency issues.This PR makes the uniffi crate register an error conversion function during client initialization, thanks to the use of a new
uniffi-error
crate. It also updates all the calls tocustom_type!
to use this new error conversion.⏰ Reminders before review
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 confirmedissue 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