-
Notifications
You must be signed in to change notification settings - Fork 736
[gui] Enhance FFI library loading #4179
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
Conversation
* add error handling * providerize FFI loading * update providers to check FFI availability
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4179 +/- ##
=======================================
Coverage 89.31% 89.31%
=======================================
Files 259 259
Lines 15684 15684
=======================================
Hits 14008 14008
Misses 1676 1676 ☔ 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.
I'm trusting you with the finer points of engineering Dart code, I'm wondering if it's possible to make the text selectable/copyable?
|
|
||
| return IgnorePointer( | ||
| ignoring: available, | ||
| ignoring: |
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.
Do you mean to no longer have available here?
|
You can't make the text selectable? @levkropp |
|
I added a button to copy the entire error to the clipboard. It seems more in line with how we do copying in multipass i.e with CopyableText (click to copy) and is faster for getting the error, but I have no strong feelings about it being just a SelectableText since this is a debug dialog. |
|
Tested in a local copy, the error message is being displayed when the libdart_ffi.so is absent in the library search path: Also, the message has a nice copy button, and it works: The The message disappears when I start the GUI with LD_LIBRARY_PATH: |
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.
LGTM, good job! Thanks for taking care of this one, @levkropp!
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.
This looks good now. Thanks for listening to my nitpicks @levkropp! 😄

resolves #4175
This pull request introduces changes to improve error handling and user experience when the FFI library fails to load. The updates include a new mechanism to detect FFI availability, enhancements to the
DaemonUnavailablewidget, and modifications to providers for better integration.Error Handling for FFI Library:
src/client/gui/lib/ffi.dart: Introduced theFFILibraryclass to encapsulate FFI library loading logic, handle errors gracefully, and provide utility methods (isFFIAvailableandffiLoadError) for checking availability and accessing load errors.User Interface Enhancements:
src/client/gui/lib/daemon_unavailable.dart: Updated theDaemonUnavailablewidget to display a fatal error message and an "Exit Application" button when the FFI library fails to load. Added a conditional check forffiAvailableProviderto differentiate between fatal errors and regular daemon unavailability. [1] [2]Provider Updates:
src/client/gui/lib/providers.dart: Added a new provider,ffiAvailableProvider, to propagate the FFI availability status throughout the application. UpdatedgrpcClientProvideranddaemonAvailableProviderto incorporate FFI availability checks, ensuring dependent functionality behaves appropriately when the FFI library is unavailable. [1] [2]