rudderlabs / rudder-sdk-react-native

Repository for RudderStack's React Native SDK - to track your event data via RudderStack.
https://www.rudderstack.com
Other
17 stars 18 forks source link

Can't update persistent context after `reset` #369

Open elliotdickison opened 2 weeks ago

elliotdickison commented 2 weeks ago

We are setting custom context via setup. This context includes details about our app that we want to persist for all RudderStack events across all sessions. This works as expected until we call reset when a user signs out. This blows away the persistent context without leaving us a way to restore it. We've tried:

I don't think there are really any bugs here. The docs clearly state that calling reset will blow away persistent context. I'd call this a feature request for surfacing putCustomContext via the React Native bridge so that we can update context after a reset.

1abhishekpandey commented 2 weeks ago

Hey @elliotdickison,

Thank you for submitting this feature request. I’ll ensure it is forwarded to our team.

elliotdickison commented 2 weeks ago

@1abhishekpandey Your suggestion to set custom context as traits via identify after a call to reset and then extract the context on the server via a transformer seems to be working well. I originally mis-read your suggestion as setting context via identify which does not work, but setting traits does the trick. Thank you!