-
Notifications
You must be signed in to change notification settings - Fork 119
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
About using new session in AnalyticsClient #2759
Comments
Hi @AumJobs, our team member will take a look into the issue. |
Hi @AumJobs , Can you please elaborate the part where you said Can you also provide some log information from LogCat with the tag Thank you! |
Hi @yuhengshs Due to the nature of the app service, we initialized when the first Amplify SDK reference occurs, not in Application.onCreate(). However, my suggestion is that if the sessionClient's session is null, as shared as a link in the body, the current SDK logic for creating a new session does not update the sessionClient with this created session, hence my request for improvement. It would be great if you could focus on the enhancement request to update the sessionClient when a new Session() is created. Thank you ! |
Hi @AumJobs, thanks for your patience. I took a look at the code you linked and I can kind of see where you're coming from but ultimately I think it may be a symptom of a different issue. Tracing through the code for AutoSessionTracker there shouldn't be a scenario where If AutoSessionTracker is working properly, startSession should already be called automatically when the app comes into the foreground and that session should be persisted via SessionClient. So when the app goes into the background, Can you do a further investigation from your side to track down what's causing your specific edge case as this is the first we've seen a report of this happening? |
Before opening, please confirm:
Language and Async Model
Kotlin
Amplify Categories
Analytics
Gradle script dependencies
Environment information
Please include any relevant guides or documentation you're referencing
No response
Describe the feature request
When I did not initialize Amplify at the Application level,
AutoSessionTracker was behaving strangely.
This prevented sessions from being created and deleted properly.
After that, a new session was created every time we sent an event.
While trying to figure out what was causing this issue, I came across a suggestion in AnalyticsClient > createEvent.
In createEvent, if the session of sessionClient doesn't exist, we create a new Session and pass it over.
In this case, the newly created session is not stored in the sessionClient and seems to be created anew each time.
If this is not the intention, my suggestion would be to save the session to the sessionClient when it is newly created.
This would make the behavior a bit more understandable.
Thanks!
link
Initialization steps (if applicable)
No response
Code Snippet
// Put your code below this line.
amplifyconfiguration.json
No response
GraphQL Schema
Additional information and screenshots
No response
The text was updated successfully, but these errors were encountered: