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/onboarding analytics #418

Merged
merged 13 commits into from
Oct 3, 2022

Conversation

cnguyen812
Copy link
Contributor

This PR refactors some of the onboarding logic so that if resuming onboarding from a closed app, analytics is still initialized.

  • refactored the route caching to be a little more robust: properly memoized the debounce and used the index prop instead of length - 1 to read the child route properly
  • previously it would always cache the Onboarding Notifications screen
  • previously, analytics was only init from Onboarding Start, if the user closed and reopened the app it wouldn't kick off analytics
  • added a queue for Segment events so any events that happened to fire before analytics has a chance to init get queued up
  • removed our call to init the AppsFlyer SDK because the Segment SDK AppsFlyer plugin we use does this internally (we still require the AppsFlyer dependency even though it's included in the plugin because of pods and stuff)

Smaller stuff:

  • moved some side-effects out of the app reducer function
  • removed some unnecessarily nested promises (anti-pattern)

@JohnathanWhite JohnathanWhite merged commit d9d4e18 into bitpay:master Oct 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants