Skip to content

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

Open
wants to merge 21 commits into
base: main
Choose a base branch
from

Conversation

visumickey
Copy link
Contributor

No description provided.

mrober and others added 19 commits October 10, 2023 16:16
#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.
@google-oss-bot
Copy link
Contributor

google-oss-bot commented Oct 17, 2023

Coverage Report 1

Affected Products

No changes between base commit (113b771) and merge commit (5d7e578).

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/WUPCqoyKeS.html

@github-actions
Copy link
Contributor

github-actions bot commented Oct 17, 2023

Unit Test Results

  57 files    57 suites   2m 0s ⏱️
975 tests 974 ✔️ 0 💤 1
983 runs  982 ✔️ 0 💤 1

For more details on these failures, see this check.

Results for commit bb8c30b.

♻️ This comment has been updated with latest results.

Copy link
Member

@raymondlam raymondlam left a 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()) {
Copy link
Member

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?

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Oct 17, 2023

Size Report 1

Affected Products

  • base

    TypeBase (113b771)Merge (5d7e578)Diff
    apk (aggressive)?8.39 kB? (?)
    apk (release)?8.66 kB? (?)
  • firebase-config

    TypeBase (113b771)Merge (5d7e578)Diff
    aar?103 kB? (?)
    apk (aggressive)?162 kB? (?)
    apk (release)?1.71 MB? (?)
  • firebase-installations

    TypeBase (113b771)Merge (5d7e578)Diff
    aar?58.8 kB? (?)
    apk (aggressive)?127 kB? (?)
    apk (release)?1.67 MB? (?)
  • firebase-installations-interop

    TypeBase (113b771)Merge (5d7e578)Diff
    aar?8.17 kB? (?)
    apk (aggressive)?65.2 kB? (?)
    apk (release)?652 kB? (?)
  • firebase-perf

    TypeBase (113b771)Merge (5d7e578)Diff
    aar?324 kB? (?)
    apk (aggressive)?1.26 MB? (?)
    apk (release)?3.78 MB? (?)
  • firebase-sessions

    TypeBase (113b771)Merge (5d7e578)Diff
    aar?148 kB? (?)
    apk (aggressive)?372 kB? (?)
    apk (release)?2.08 MB? (?)

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/48QOXlshrc.html

this.startSession = SessionManager.getInstance().perfSession();
dispatchAppStartTrace();
}

Copy link
Contributor

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?

Base automatically changed from sessions-nine to master November 6, 2023 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants