-
Notifications
You must be signed in to change notification settings - Fork 319
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
Add appSessionID
to PaywallEventsManager
#4482
base: main
Are you sure you want to change the base?
Add appSessionID
to PaywallEventsManager
#4482
Conversation
|
||
Task { | ||
await self.paywallEventsManager?.resetAppSessionID() | ||
} |
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.
I am unsure about this, but paywallEventsManager
is an actor
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.
Yeah, since paywallEventsManager
is an actor, this call has to be async. Ideally, the login function itself would be async and we wouldn't have to spawn a child task here, but that's a whole other refactor 🤷♂️
I think the biggest risk is that login()
completes before resetAppSessionID() is done, and then some event gets emitted without the new app session ID. I don't think it's likely, but if we want to be safe here, we could consider calling the completion handler in the Task after resetAppSessionID completes.
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.
It looks like we're generating an app session ID when login/logout are called, but does one get created if the developer doesn't call those functions?
I don't have the full context on this feature, so it might not be necessary, but just wanted to make sure!
@fire-at-will Yes, in the init of Btw, I am happy to change the approach :) I tested that old Paywall Events would have an associated app session ID (on the SDK only not in the event sent yet) |
Added an
appSessionID
that can be shared between all events. Since at the momentsession_identifier
in the paywalls represent the paywall session, not the whole app session.I just added the generation, a reset functionality and a fallback for now