Skip to content
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

fix: fix storage timing issue, set sessionId before plugin.setup #190

Merged

Conversation

justin-fiedler
Copy link
Contributor

@justin-fiedler justin-fiedler commented Mar 27, 2024

Summary

  • Fix storage timing issue from last commit
    • 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
      1. added via config e.g. amplitude(Configuration(plugins = listOf(pluginThatNeedsSessionIdInSetup)
      2. Added after amplitude.isBuilt.await()
  • Improved sessionId check in Plugin.setup to verify that a valid session id is set (not -1)

Checklist

  • Does your PR title have the correct title format?
  • Does your PR have a breaking change?: No

@justin-fiedler justin-fiedler self-assigned this Mar 27, 2024
@justin-fiedler justin-fiedler merged commit 84b4b9d into main Mar 27, 2024
5 checks passed
@justin-fiedler justin-fiedler deleted the AMP-96567-set-session-id-before-plugin-setup-fix branch March 27, 2024 22:52
github-actions bot pushed a commit that referenced this pull request Mar 27, 2024
## [1.16.6](v1.16.5...v1.16.6) (2024-03-27)

### Bug Fixes

* fix storage timing issue from last commit, set sessionId before plugin.setup ([#190](#190)) ([84b4b9d](84b4b9d))
Copy link

🎉 This PR is included in version 1.16.6 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants