-
Notifications
You must be signed in to change notification settings - Fork 7
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
Pre-init queue for events #243
Conversation
…ate events prior to initialize, but this method doesn't actually allow for it :oops:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these the only two we'd want that on? I know the registry set stuff is pretty agnostic of having klaviyo be initialized, but for the sake of retrying and keeping errors visible I wonder if it'd hurt us to include this on most of our safe apply calls
@dan-peluso yeah thats what I'm kinda grappling with right now. |
Thanks for the context. It makes sense it's a specific RN exception. Are there any concerns with adding it to the other safe apply calls? I usually lean towards the side of 'if someone can do it, they will' so to me it seems like this could be a good way to make errors obvious to devs. |
@dan-peluso our concern was/is basically that if we open the door to making these calls when you haven't initialized, data loss ensues if someone takes that too far and queues up operations that, if the app closes before ever initializing, we will simply lose completely because we couldn't persist the data. The classic if we give you too much rope you might hang yourself thing -- pardon the macabre i couldn't think of another idiom right now. Honestly as I re-visit the past reasoning, I think what I want this PR to be is to remove the comment from |
We have this pre-init queue specifically for push opened events, but we had the same comment on there for the standard
createEvent
method. I'm not sure whether the mistake is having the comment, or missing the preInitQueue. Given react native timing issues, i'm inclined to add the flexibility for any event creation though.