-
Notifications
You must be signed in to change notification settings - Fork 616
Wait for a valid SessionID before logging the app start event. #5437
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
base: main
Are you sure you want to change the base?
Conversation
#5397) Introduces a new SessionDataService that is bound to by each process and used to deliver session-ids.
Co-authored-by: jrothfeder <rothbutter@google.com>
Created a SessionLifecycleService class which contains all the service-side code, and a SessionLifecycleClient object which handles the connection to the server and the sending and receiving of events.
Avoid changing the api surface. Having `val`s at the file level causes Kotlin to generate a public class with the filenameKt which adds a public class to the public api surface: "The public api surface has changed for the subproject firebase-sessions: error: Added class com.google.firebase.sessions.SessionDatastoreKt [AddedClass]". So we have to put them in a class or companion object.
…ance` so it can be accessed from a bound service. (#5407) Co-authored-by: jrothfeder <rothbutter@google.com>
Make `SessionGenerator` injectable. Also made `WallClock` an object to avoid needing to pass it around. Moved `collectEvents` out of SessionGenerator since it will need to be handled in the service.
Co-authored-by: jrothfeder <rothbutter@google.com>
…ave vimean superpowers. (#5413) Co-authored-by: jrothfeder <rothbutter@google.com>
Using the SessionGenerator to generate new sessions and create SessionDetails instead of directly creating UUID session ids in the service. Also updated the boundClients queue to be a LinkedBlockingQueue to avoid ConcurrentModificationExceptions if a client binds while a message is being handled by the server.
Made SessionsSettings injectable. Also removed SessionMaintainer.
Co-authored-by: jrothfeder <rothbutter@google.com>
This will make it safe to call `Firebase.app` any time from anywhere in this SDK.
#5427) … the FirelogPublisher handle the full SessionEvent creation since that's only relevant to Firelog.
#5431) … the MainLooper which is the application main thread and so could interfere with things there. Also fixes issue with missing import.
#5434) …and use the same Messenger instance for every client. This makes sure that all state manipulation happens on the same looper, so we can get rid of the LinkedBlockingQueue or worry about volatile booleans.
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.
Could you add a test for when the session id is not set?
|
||
@Override | ||
public void updateSession(PerfSession session) { | ||
if (session.sessionId().isEmpty()) { |
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.
When is this true that updateSession is called but the id is null:
Do we need to unregister ourshelves from session updates?
Size Report 1Affected Products
Test Logs |
this.startSession = SessionManager.getInstance().perfSession(); | ||
dispatchAppStartTrace(); | ||
} | ||
|
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.
Should this call updateSession(perfSession)
instead?
No description provided.