After the last change sometimes deviceId would not be loaded in time for the session events. This fix resolves that issue by moving the storage creation back into the proper coroutine.
Set sessionId before plugin.setup()
this is once again part of buildInternal so that the storage is fully setup
We load the initial session id prior to the internal calls to add(plugin)
Note - If plugins require accurate values for sessionId in setup they must be either
added via config e.g. amplitude(Configuration(plugins = listOf(pluginThatNeedsSessionIdInSetup)
Added after amplitude.isBuilt.await()
Improved sessionId check in Plugin.setup to verify that a valid session id is set (not -1)
Checklist
[x] Does your PR title have the correct title format?
Summary
add(plugin)
sessionId
insetup
they must be eitheramplitude(Configuration(plugins = listOf(pluginThatNeedsSessionIdInSetup)
amplitude.isBuilt.await()
Checklist