You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Errors Produced in try_lift are difficult to Debug. #2563
Recently I was working on adding support for sending [Uuid] across the FFI boundary as a String. Originally, I had introduced this conversion using a bare
use uuid::Uuid;
uniffi::custom_type!(Uuid,String,{ remote });
This appeared to work on Android and iOS when converting from ParcelUuid and CBUUID respectively, but would periodically crash with just "invalid length: expected length 32 for simple format, found 4" when running on iOS. This message is coming from the error returned from Uuid::try_from(String), which was being lifted for a field of type Vec<Uuid>, and was being passed a short UUID as specified by Bluetooth 4.
I understand that this isn't necessarily this libraries responsibility, but it would be really nice if (when the ffi-trace feature is enabled) more context would be attached to the anyhow report to aid in debugging.
I'm thinking:
Unconditionally attach type names and source location information to custom_type!() invocations.
I would also be interested in contributing to these changes, if they are something that the project would be interested in but aren't a high priority for anyone else atm.
Activity
oldwomanjosiah commentedon Jun 6, 2025
I would also be interested in contributing to these changes, if they are something that the project would be interested in but aren't a high priority for anyone else atm.
mhammond commentedon Jun 7, 2025
hi, thanks for looking at uniffi! We'd be happy to look at zero (ish?) cost improvements to our diagnostics here.
mhammond commentedon Aug 4, 2025
Let's call this fixed by #2564, but we'd welcome more improvements or concrete problem cases in new PRs/issues.