Skip to content

fix: removes Inject plugins #837

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

Merged
merged 1 commit into from
May 25, 2023
Merged

fix: removes Inject plugins #837

merged 1 commit into from
May 25, 2023

Conversation

oscb
Copy link
Contributor

@oscb oscb commented May 24, 2023

Adding and storing context and userInfo is now completely handled in the client, outside of the timeline.

This is to prevent concurrency issues in the timeline where plugins could hold off updating the userInfo, or direct operations like reset could cause an processing event to contain information not representative from the sequential order when it was captured.

applyRawEventData now is the capture moment before timeline/plugin processing starts, capturing all the data relevant to the event at a single moment.

This is the first step towards completely removing shared state.

  • Removes InjectContext and InjectUserInfo plugins
  • Removes InjectTraits example too as it is now discouraged to access shared state from any plugin. (Plugins should operate only with event data or its own state).
  • Client now awaits fetchSettings first before triggering any lifecycle and context events. This guarantees plugins that use SegmentSettings will have them available before any events are captured. (WIP)

Copy link
Contributor

@alanjcharles alanjcharles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@oscb oscb merged commit ce56c9e into master May 25, 2023
@oscb oscb deleted the oscb/removeInjectPlugins branch May 25, 2023 16:13
oscb pushed a commit that referenced this pull request Jun 2, 2023
## [@segment/analytics-react-native-v2.15.0](https://github.com/segmentio/analytics-react-native/compare/@segment/analytics-react-native-v2.14.0...@segment/analytics-react-native-v2.15.0) (2023-06-02)

### Features

* add config option for cdn proxy ([#834](#834)) ([95562ed](95562ed))

### Bug Fixes

* fix flush policies reference copy, add BackgroundPolicy ([#838](#838)) ([e4b558a](e4b558a))
* queue storage fixes ([#836](#836)) ([f5a6a86](f5a6a86))
* removes Inject plugins ([#837](#837)) ([ce56c9e](ce56c9e))
* update braze example and readme ([#830](#830)) ([b6a319a](b6a319a))
@oscb
Copy link
Contributor Author

oscb commented Jun 2, 2023

🎉 This PR is included in version @segment/analytics-react-native-v2.15.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@oscb oscb added the released label Jun 2, 2023
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.

2 participants