Description
The Nimbus SDK crate uses viaduct for networking. For it to work on Android, the consuming app must initialize and configure a viaduct backend as part of application startup, which app-services consumers currently do using the rusthttp support component. Ideally this would "just work" for such consumers when they come to use the Nimbus SDK.
Problem: rusthttp is part of the appservices megazord, which means that it configures the instance of viaduct that's bundled with the appservices megazord. Nimbus-SDK ships as its own standalone binary, so it has a separate copy of viaduct that does not share this configuration.
There are a couple of ways we could go here:
- Provide a way for the application to configure the http backend for nimbus, e.g. some sort of "Nimbus.setHttpClient()" call that is has to do on startup next to its current call to "RustHttpConfig.setClient".
- This would keep nimbus standalone, but IMHO would be a bit weird for consumers.
- I don't know what bad things might happen having two versions of viaduct loaded into the same application. Maybe nothing...?
- Bundle Nimbus SDK into the app-services megazord, so that it shares the same instance of viaduct.
- I don't honestly recall our reasons for not doing this, but I'm sure we had some.
- Have Nimbus SDK dynamically link against the instance of viaduct that's in the appservices megazord.
- This keeps Nimbus as a standalone thing, but would be of unknown technical complexity. Might be fun to try though!
I'm personally leaning towards "bundle Nimbus in the app-services Megazord" as the short-term solution here, but I don't feel like I understand the landscape in sufficient detail to be confident it's the right thing.
Thoughts?
┆Issue is synchronized with this Jira Task
┆Epic: Nimbus Fenix Client SDK
┆Sprint: SYNC - end 2020-10-08