Skip to content

Add thread safe FirebaseSessionsDependencies #4983

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

Merged
merged 6 commits into from
May 12, 2023
Merged

Conversation

mrober
Copy link
Contributor

@mrober mrober commented May 5, 2023

Add thread safe FirebaseSessionsDependencies. All the thread safe code will live in this class.

FirebaseSessions will use this to get all the dependencies after they have been registered by calling getSubscribers() in a coroutine, and it will block until all dependencies are registered. This is kind of like how on iOS it uses promises and waits for them to be fulfilled, except it uses a Mutex that gets added as locked and not unlocked until the dependency resisters itself.

@github-actions
Copy link
Contributor

github-actions bot commented May 5, 2023

Unit Test Results

24 files  24 suites   43s ⏱️
42 tests 42 ✔️ 0 💤 0
84 runs  84 ✔️ 0 💤 0

Results for commit 9e67118.

♻️ This comment has been updated with latest results.

@google-oss-bot
Copy link
Contributor

google-oss-bot commented May 5, 2023

Coverage Report 1

Affected Products

  • firebase-sessions

    Overall coverage changed from ? (c61d5c5) to 70.36% (0920dd3) by ?.

    19 individual files with coverage change

    FilenameBase (c61d5c5)Merge (0920dd3)Diff
    ApplicationInfo.kt?100.00%?
    EventGDTLogger.kt?75.00%?
    FirebaseSessions.kt?0.00%?
    FirebaseSessionsDependencies.kt?91.30%?
    FirebaseSessionsEarly.kt?0.00%?
    FirebaseSessionsRegistrar.kt?0.00%?
    LocalOverrideSettings.kt?88.46%?
    RemoteSettings.kt?86.25%?
    RemoteSettingsFetcher.kt?3.03%?
    SessionCoordinator.kt?76.47%?
    SessionEvent.kt?100.00%?
    SessionEvents.kt?98.73%?
    SessionGenerator.kt?20.00%?
    SessionInitiator.kt?66.67%?
    SessionsSettings.kt?90.00%?
    SessionSubscriber.kt?66.67%?
    SettingsCache.kt?94.12%?
    SettingsProvider.kt?0.00%?
    Time.kt?0.00%?

Test Logs

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

@google-oss-bot
Copy link
Contributor

google-oss-bot commented May 5, 2023

Size Report 1

Affected Products

  • base

    TypeBase (c61d5c5)Merge (0920dd3)Diff
    apk (aggressive)?8.39 kB? (?)
    apk (release)?8.65 kB? (?)
  • firebase-datatransport

    TypeBase (c61d5c5)Merge (0920dd3)Diff
    aar?4.94 kB? (?)
    apk (aggressive)?161 kB? (?)
    apk (release)?1.35 MB? (?)
  • firebase-sessions

    TypeBase (c61d5c5)Merge (0920dd3)Diff
    aar?105 kB? (?)

Test Logs

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

@github-actions
Copy link
Contributor

github-actions bot commented May 5, 2023

Javadoc Changes:
--- /Users/runner/diff/original/firebase-kotlindoc/android/client/firebase-sessions/_toc.yaml	2023-05-12 17:34:35.000000000 +0000
+++ /Users/runner/diff/modified/firebase-kotlindoc/android/client/firebase-sessions/_toc.yaml	2023-05-12 17:29:02.000000000 +0000
@@ -9,6 +9,30 @@
     - title: "FirebaseSessions"
       path: "/docs/reference/android/com/google/firebase/sessions/FirebaseSessions.html"
 
+- title: "firebase.sessions.api"
+  path: "/docs/reference/android/com/google/firebase/sessions/api/package-summary.html"
+
+  section:
+  - title: "Interfaces"
+
+    section:
+    - title: "SessionSubscriber"
+      path: "/docs/reference/android/com/google/firebase/sessions/api/SessionSubscriber.html"
+
+  - title: "Classes"
+
+    section:
+    - title: "FirebaseSessionsDependencies"
+      path: "/docs/reference/android/com/google/firebase/sessions/api/FirebaseSessionsDependencies.html"
+    - title: "SessionSubscriber.SessionDetails"
+      path: "/docs/reference/android/com/google/firebase/sessions/api/SessionSubscriber.SessionDetails.html"
+
+  - title: "Enums"
+
+    section:
+    - title: "SessionSubscriber.Name"
+      path: "/docs/reference/android/com/google/firebase/sessions/api/SessionSubscriber.Name.html"
+
 - title: "firebase.sessions.settings"
   path: "/docs/reference/android/com/google/firebase/sessions/settings/package-summary.html"
 
--- /Users/runner/diff/original/firebase-kotlindoc/android/com/google/firebase/sessions/api/FirebaseSessionsDependencies.html	1970-01-01 00:00:00.000000000 +0000
+++ /Users/runner/diff/modified/firebase-kotlindoc/android/com/google/firebase/sessions/api/FirebaseSessionsDependencies.html	2023-05-12 17:29:02.000000000 +0000
@@ -0,0 +1,77 @@
+<html devsite="true">
+  <head>
+    <title>FirebaseSessionsDependencies</title>
+{% setvar book_path %}/_book.yaml{% endsetvar %}
+{% include "docs/reference/android/_reference-head-tags.html" %}
+  </head>
+  <body>
+    <div id="metadata-info-block"></div>
+    <h1>FirebaseSessionsDependencies</h1>
+    <p>
+      <pre>public static class <a href="/docs/reference/android/com/google/firebase/sessions/api/FirebaseSessionsDependencies.html">FirebaseSessionsDependencies</a></pre>
+    </p>
+    <hr>
+    <p><code><a href="/docs/reference/android/com/google/firebase/sessions/api/FirebaseSessionsDependencies.html">FirebaseSessionsDependencies</a></code> determines when a dependent SDK is installed in the app. The Sessions SDK uses this to figure out which dependencies to wait for to getting the data collection state. This is thread safe.</p>
+    <p>This is important because the Sessions SDK starts up before dependent SDKs.</p>
+    <h2>Summary</h2>
+    <div class="devsite-table-wrapper">
+      <table class="responsive">
+        <colgroup>
+          <col width="40%">
+          <col>
+        </colgroup>
+        <thead>
+          <tr>
+            <th colspan="100%"><h3>Public fields</h3></th>
+          </tr>
+        </thead>
+        <tbody class="list">
+          <tr>
+            <td><code>static @<a href="https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html">NonNull</a> <a href="/docs/reference/android/com/google/firebase/sessions/api/FirebaseSessionsDependencies.html">FirebaseSessionsDependencies</a></code></td>
+            <td>
+              <div><code><a href="/docs/reference/android/com/google/firebase/sessions/api/FirebaseSessionsDependencies.html#INSTANCE()">INSTANCE</a></code></div>
+            </td>
+          </tr>
+        </tbody>
+      </table>
+    </div>
+    <div class="devsite-table-wrapper">
+      <table class="responsive">
+        <colgroup>
+          <col width="40%">
+          <col>
+        </colgroup>
+        <thead>
+          <tr>
+            <th colspan="100%"><h3>Public methods</h3></th>
+          </tr>
+        </thead>
+        <tbody class="list">
+          <tr>
+            <td><code>static&nbsp;final void</code></td>
+            <td>
+              <div><code><a href="/docs/reference/android/com/google/firebase/sessions/api/FirebaseSessionsDependencies.html#addDependency(com.google.firebase.sessions.api.SessionSubscriber.Name)">addDependency</a>(@<a href="https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html">NonNull</a> <a href="/docs/reference/android/com/google/firebase/sessions/api/SessionSubscriber.Name.html">SessionSubscriber.Name</a>&nbsp;subscriberName)</code></div>
+              <p>Add a subscriber as a dependency to the Sessions SDK.</p>
+            </td>
+          </tr>
+        </tbody>
+      </table>
+    </div>
+    <div class="list">
+      <h2>Public fields</h2>
+      <div class="api-item"><a name="getINSTANCE()"></a><a name="setINSTANCE()"></a><a name="getINSTANCE--"></a><a name="setINSTANCE--"></a>
+        <h3 class="api-name" id="INSTANCE()">INSTANCE</h3>
+        <pre class="api-signature no-pretty-print">public&nbsp;static&nbsp;@<a href="https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html">NonNull</a> <a href="/docs/reference/android/com/google/firebase/sessions/api/FirebaseSessionsDependencies.html">FirebaseSessionsDependencies</a>&nbsp;<a href="/docs/reference/android/com/google/firebase/sessions/api/FirebaseSessionsDependencies.html#INSTANCE()">INSTANCE</a></pre>
+      </div>
+    </div>
+    <div class="list">
+      <h2>Public methods</h2>
+      <div class="api-item"><a name="addDependency-com.google.firebase.sessions.api.SessionSubscriber.Name-"></a><a name="adddependency"></a>
+        <h3 class="api-name" id="addDependency(com.google.firebase.sessions.api.SessionSubscriber.Name)">addDependency</h3>
+        <pre class="api-signature no-pretty-print">public&nbsp;static&nbsp;final&nbsp;void&nbsp;<a href="/docs/reference/android/com/google/firebase/sessions/api/FirebaseSessionsDependencies.html#addDependency(com.google.firebase.sessions.api.SessionSubscriber.Name)">addDependency</a>(@<a href="https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html">NonNull</a> <a href="/docs/reference/android/com/google/firebase/sessions/api/SessionSubscriber.Name.html">SessionSubscriber.Name</a>&nbsp;subscriberName)</pre>
+        <p>Add a subscriber as a dependency to the Sessions SDK. Every dependency must register itself, or the Sessions SDK will never generate a session.</p>
+      </div>
+    </div>
+  </body>
+</html>
+
--- /Users/runner/diff/original/firebase-kotlindoc/android/com/google/firebase/sessions/api/SessionSubscriber.Name.html	1970-01-01 00:00:00.000000000 +0000
+++ /Users/runner/diff/modified/firebase-kotlindoc/android/com/google/firebase/sessions/api/SessionSubscriber.Name.html	2023-05-12 17:29:02.000000000 +0000
@@ -0,0 +1,134 @@
+<html devsite="true">
+  <head>
+    <title>SessionSubscriber.Name</title>
+{% setvar book_path %}/_book.yaml{% endsetvar %}
+{% include "docs/reference/android/_reference-head-tags.html" %}
+  </head>
+  <body>
+    <div id="metadata-info-block"></div>
+    <h1>SessionSubscriber.Name</h1>
+    <p>
+      <pre>public enum <a href="/docs/reference/android/com/google/firebase/sessions/api/SessionSubscriber.Name.html">SessionSubscriber.Name</a> extends <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-enum/index.html">Enum</a></pre>
+    </p>
+    <div class="devsite-table-wrapper">
+      <table class="jd-inheritance-table">
+        <tbody>
+          <tr>
+            <td colspan="3"><a href="https://developer.android.com/reference/kotlin/java/lang/Object.html">java.lang.Object</a></td>
+          </tr>
+          <tr>
+            <td class="jd-inheritance-space">&nbsp;&nbsp;&nbsp;↳</td>
+            <td colspan="2"><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-enum/index.html">kotlin.Enum</a></td>
+          </tr>
+          <tr>
+            <td>&nbsp;</td>
+            <td class="jd-inheritance-space">&nbsp;&nbsp;&nbsp;↳</td>
+            <td colspan="1"><a href="/docs/reference/android/com/google/firebase/sessions/api/SessionSubscriber.Name.html">com.google.firebase.sessions.api.SessionSubscriber.Name</a></td>
+          </tr>
+        </tbody>
+      </table>
+    </div>
+    <hr>
+    <p><code><a href="/docs/reference/android/com/google/firebase/sessions/api/SessionSubscriber.Name.html">SessionSubscriber.Name</a></code>s are used for identifying subscribers.</p>
+    <h2>Summary</h2>
+    <div class="devsite-table-wrapper">
+      <table class="responsive">
+        <colgroup>
+          <col width="40%">
+          <col>
+        </colgroup>
+        <thead>
+          <tr>
+            <th colspan="100%"><h3>Enum Values</h3></th>
+          </tr>
+        </thead>
+        <tbody class="list">
+          <tr>
+            <td><code><a href="/docs/reference/android/com/google/firebase/sessions/api/SessionSubscriber.Name.html#CRASHLYTICS">CRASHLYTICS</a></code></td>
+            <td></td>
+          </tr>
+          <tr>
+            <td><code><a href="/docs/reference/android/com/google/firebase/sessions/api/SessionSubscriber.Name.html#PERFORMANCE">PERFORMANCE</a></code></td>
+            <td></td>
+          </tr>
+        </tbody>
+      </table>
+    </div>
+    <div class="devsite-table-wrapper">
+      <table class="responsive">
+        <colgroup>
+          <col width="40%">
+          <col>
+        </colgroup>
+        <thead>
+          <tr>
+            <th colspan="100%"><h3>Public methods</h3></th>
+          </tr>
+        </thead>
+        <tbody class="list">
+          <tr>
+            <td><code>final @<a href="https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html">NonNull</a> <a href="/docs/reference/android/com/google/firebase/sessions/api/SessionSubscriber.Name.html">SessionSubscriber.Name</a></code></td>
+            <td>
+              <div><code><a href="/docs/reference/android/com/google/firebase/sessions/api/SessionSubscriber.Name.html#valueOf(kotlin.String)">valueOf</a>(@<a href="https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/kotlin/java/lang/String.html">String</a>&nbsp;value)</code></div>
+              <p>Returns the enum constant of this type with the specified name.</p>
+            </td>
+          </tr>
+          <tr>
+            <td><code>final @<a href="https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html">NonNull</a> SessionSubscriber.Name[]</code></td>
+            <td>
+              <div><code><a href="/docs/reference/android/com/google/firebase/sessions/api/SessionSubscriber.Name.html#values()">values</a>()</code></div>
+              <p>Returns an array containing the constants of this enum type, in the order they're declared.</p>
+            </td>
+          </tr>
+        </tbody>
+      </table>
+    </div>
+    <div class="list">
+      <h2>Enum Values</h2>
+      <div class="api-item">
+        <h3 class="api-name" id="CRASHLYTICS">CRASHLYTICS</h3>
+        <pre class="api-signature no-pretty-print"><a href="/docs/reference/android/com/google/firebase/sessions/api/SessionSubscriber.Name.html">SessionSubscriber.Name</a>&nbsp;<a href="/docs/reference/android/com/google/firebase/sessions/api/SessionSubscriber.Name.html#CRASHLYTICS">SessionSubscriber.Name.CRASHLYTICS</a></pre>
+      </div>
+      <div class="api-item">
+        <h3 class="api-name" id="PERFORMANCE">PERFORMANCE</h3>
+        <pre class="api-signature no-pretty-print"><a href="/docs/reference/android/com/google/firebase/sessions/api/SessionSubscriber.Name.html">SessionSubscriber.Name</a>&nbsp;<a href="/docs/reference/android/com/google/firebase/sessions/api/SessionSubscriber.Name.html#PERFORMANCE">SessionSubscriber.Name.PERFORMANCE</a></pre>
+      </div>
+    </div>
+    <div class="list">
+      <h2>Public methods</h2>
+      <div class="api-item"><a name="valueOf-kotlin.String-"></a><a name="valueof"></a>
+        <h3 class="api-name" id="valueOf(kotlin.String)">valueOf</h3>
+        <pre class="api-signature no-pretty-print">public&nbsp;final&nbsp;@<a href="https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html">NonNull</a> <a href="/docs/reference/android/com/google/firebase/sessions/api/SessionSubscriber.Name.html">SessionSubscriber.Name</a>&nbsp;<a href="/docs/reference/android/com/google/firebase/sessions/api/SessionSubscriber.Name.html#valueOf(kotlin.String)">valueOf</a>(@<a href="https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/kotlin/java/lang/String.html">String</a>&nbsp;value)</pre>
+        <p>Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)</p>
+        <div class="devsite-table-wrapper">
+          <table class="responsive">
+            <colgroup>
+              <col width="40%">
+              <col>
+            </colgroup>
+            <thead>
+              <tr>
+                <th colspan="100%">Throws</th>
+              </tr>
+            </thead>
+            <tbody class="list">
+              <tr>
+                <td><code><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-illegal-argument-exception/index.html">kotlin.IllegalArgumentException</a>&nbsp;kotlin.IllegalArgumentException</code></td>
+                <td>
+                  <p>if this enum type has no constant with the specified name</p>
+                </td>
+              </tr>
+            </tbody>
+          </table>
+        </div>
+      </div>
+      <div class="api-item"><a name="values--"></a><a name="values"></a>
+        <h3 class="api-name" id="values()">values</h3>
+        <pre class="api-signature no-pretty-print">public&nbsp;final&nbsp;@<a href="https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html">NonNull</a> SessionSubscriber.Name[]&nbsp;<a href="/docs/reference/android/com/google/firebase/sessions/api/SessionSubscriber.Name.html#values()">values</a>()</pre>
+        <p>Returns an array containing the constants of this enum type, in the order they're declared.</p>
+        <p>This method may be used to iterate over the constants.</p>
+      </div>
+    </div>
+  </body>
+</html>
+
--- /Users/runner/diff/original/firebase-kotlindoc/android/com/google/firebase/sessions/api/SessionSubscriber.SessionDetails.html	1970-01-01 00:00:00.000000000 +0000
+++ /Users/runner/diff/modified/firebase-kotlindoc/android/com/google/firebase/sessions/api/SessionSubscriber.SessionDetails.html	2023-05-12 17:29:02.000000000 +0000
@@ -0,0 +1,73 @@
+<html devsite="true">
+  <head>
+    <title>SessionSubscriber.SessionDetails</title>
+{% setvar book_path %}/_book.yaml{% endsetvar %}
+{% include "docs/reference/android/_reference-head-tags.html" %}
+  </head>
+  <body>
+    <div id="metadata-info-block"></div>
+    <h1>SessionSubscriber.SessionDetails</h1>
+    <p>
+      <pre>public final data class <a href="/docs/reference/android/com/google/firebase/sessions/api/SessionSubscriber.SessionDetails.html">SessionSubscriber.SessionDetails</a></pre>
+    </p>
+    <hr>
+    <p><code><a href="/docs/reference/android/com/google/firebase/sessions/api/SessionSubscriber.SessionDetails.html">SessionDetails</a></code> contains session data passed to subscribers whenever the session changes</p>
+    <h2>Summary</h2>
+    <div class="devsite-table-wrapper">
+      <table class="responsive">
+        <colgroup>
+          <col width="40%">
+          <col>
+        </colgroup>
+        <thead>
+          <tr>
+            <th colspan="100%"><h3>Public fields</h3></th>
+          </tr>
+        </thead>
+        <tbody class="list">
+          <tr>
+            <td><code>final @<a href="https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/kotlin/java/lang/String.html">String</a></code></td>
+            <td>
+              <div><code><a href="/docs/reference/android/com/google/firebase/sessions/api/SessionSubscriber.SessionDetails.html#sessionId()">sessionId</a></code></div>
+            </td>
+          </tr>
+        </tbody>
+      </table>
+    </div>
+    <div class="devsite-table-wrapper">
+      <table class="responsive">
+        <colgroup>
+          <col width="40%">
+          <col>
+        </colgroup>
+        <thead>
+          <tr>
+            <th colspan="100%"><h3>Public constructors</h3></th>
+          </tr>
+        </thead>
+        <tbody class="list">
+          <tr>
+            <td>
+              <div><code><a href="/docs/reference/android/com/google/firebase/sessions/api/SessionSubscriber.SessionDetails.html#SessionDetails(kotlin.String)">SessionDetails</a>(@<a href="https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/kotlin/java/lang/String.html">String</a>&nbsp;sessionId)</code></div>
+            </td>
+          </tr>
+        </tbody>
+      </table>
+    </div>
+    <div class="list">
+      <h2>Public fields</h2>
+      <div class="api-item"><a name="getSessionId()"></a><a name="setSessionId()"></a><a name="getSessionId--"></a><a name="setSessionId--"></a>
+        <h3 class="api-name" id="sessionId()">sessionId</h3>
+        <pre class="api-signature no-pretty-print">public&nbsp;final&nbsp;@<a href="https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/kotlin/java/lang/String.html">String</a>&nbsp;<a href="/docs/reference/android/com/google/firebase/sessions/api/SessionSubscriber.SessionDetails.html#sessionId()">sessionId</a></pre>
+      </div>
+    </div>
+    <div class="list">
+      <h2>Public constructors</h2>
+      <div class="api-item"><a name="SessionDetails-kotlin.String-"></a><a name="sessiondetails"></a>
+        <h3 class="api-name" id="SessionDetails(kotlin.String)">SessionDetails</h3>
+        <pre class="api-signature no-pretty-print">public&nbsp;<a href="/docs/reference/android/com/google/firebase/sessions/api/SessionSubscriber.SessionDetails.html#SessionDetails(kotlin.String)">SessionDetails</a>(@<a href="https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/kotlin/java/lang/String.html">String</a>&nbsp;sessionId)</pre>
+      </div>
+    </div>
+  </body>
+</html>
+
--- /Users/runner/diff/original/firebase-kotlindoc/android/com/google/firebase/sessions/api/SessionSubscriber.html	1970-01-01 00:00:00.000000000 +0000
+++ /Users/runner/diff/modified/firebase-kotlindoc/android/com/google/firebase/sessions/api/SessionSubscriber.html	2023-05-12 17:29:02.000000000 +0000
@@ -0,0 +1,111 @@
+<html devsite="true">
+  <head>
+    <title>SessionSubscriber</title>
+{% setvar book_path %}/_book.yaml{% endsetvar %}
+{% include "docs/reference/android/_reference-head-tags.html" %}
+  </head>
+  <body>
+    <div id="metadata-info-block"></div>
+    <h1>SessionSubscriber</h1>
+    <p>
+      <pre>public interface <a href="/docs/reference/android/com/google/firebase/sessions/api/SessionSubscriber.html">SessionSubscriber</a></pre>
+    </p>
+    <hr>
+    <p><code><a href="/docs/reference/android/com/google/firebase/sessions/api/SessionSubscriber.html">SessionSubscriber</a></code> is an interface that dependent SDKs must implement.</p>
+    <h2>Summary</h2>
+    <div class="devsite-table-wrapper">
+      <table class="responsive">
+        <colgroup>
+          <col width="40%">
+          <col>
+        </colgroup>
+        <thead>
+          <tr>
+            <th colspan="100%"><h3>Nested types</h3></th>
+          </tr>
+        </thead>
+        <tbody class="list">
+          <tr>
+            <td>
+              <div><code>public enum <a href="/docs/reference/android/com/google/firebase/sessions/api/SessionSubscriber.Name.html">SessionSubscriber.Name</a> extends <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-enum/index.html">Enum</a></code></div>
+              <p><code><a href="/docs/reference/android/com/google/firebase/sessions/api/SessionSubscriber.Name.html">SessionSubscriber.Name</a></code>s are used for identifying subscribers.</p>
+            </td>
+          </tr>
+          <tr>
+            <td>
+              <div><code>public final data class <a href="/docs/reference/android/com/google/firebase/sessions/api/SessionSubscriber.SessionDetails.html">SessionSubscriber.SessionDetails</a></code></div>
+              <p><code><a href="/docs/reference/android/com/google/firebase/sessions/api/SessionSubscriber.SessionDetails.html">SessionDetails</a></code> contains session data passed to subscribers whenever the session changes</p>
+            </td>
+          </tr>
+        </tbody>
+      </table>
+    </div>
+    <div class="devsite-table-wrapper">
+      <table class="responsive">
+        <colgroup>
+          <col width="40%">
+          <col>
+        </colgroup>
+        <thead>
+          <tr>
+            <th colspan="100%"><h3>Public fields</h3></th>
+          </tr>
+        </thead>
+        <tbody class="list">
+          <tr>
+            <td><code>abstract boolean</code></td>
+            <td>
+              <div><code><a href="/docs/reference/android/com/google/firebase/sessions/api/SessionSubscriber.html#isDataCollectionEnabled()">isDataCollectionEnabled</a></code></div>
+            </td>
+          </tr>
+          <tr>
+            <td><code>abstract @<a href="https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html">NonNull</a> <a href="/docs/reference/android/com/google/firebase/sessions/api/SessionSubscriber.Name.html">SessionSubscriber.Name</a></code></td>
+            <td>
+              <div><code><a href="/docs/reference/android/com/google/firebase/sessions/api/SessionSubscriber.html#sessionSubscriberName()">sessionSubscriberName</a></code></div>
+            </td>
+          </tr>
+        </tbody>
+      </table>
+    </div>
+    <div class="devsite-table-wrapper">
+      <table class="responsive">
+        <colgroup>
+          <col width="40%">
+          <col>
+        </colgroup>
+        <thead>
+          <tr>
+            <th colspan="100%"><h3>Public methods</h3></th>
+          </tr>
+        </thead>
+        <tbody class="list">
+          <tr>
+            <td><code>abstract void</code></td>
+            <td>
+              <div><code><a href="/docs/reference/android/com/google/firebase/sessions/api/SessionSubscriber.html#onSessionChanged(com.google.firebase.sessions.api.SessionSubscriber.SessionDetails)">onSessionChanged</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html">NonNull</a> <a href="/docs/reference/android/com/google/firebase/sessions/api/SessionSubscriber.SessionDetails.html">SessionSubscriber.SessionDetails</a>&nbsp;sessionDetails<br>)</code></div>
+            </td>
+          </tr>
+        </tbody>
+      </table>
+    </div>
+    <div class="list">
+      <h2>Public fields</h2>
+      <div class="api-item"><a name="getIsDataCollectionEnabled()"></a><a name="setIsDataCollectionEnabled()"></a><a name="getIsDataCollectionEnabled--"></a><a name="setIsDataCollectionEnabled--"></a>
+        <h3 class="api-name" id="isDataCollectionEnabled()">isDataCollectionEnabled</h3>
+        <pre class="api-signature no-pretty-print">abstract&nbsp;boolean&nbsp;<a href="/docs/reference/android/com/google/firebase/sessions/api/SessionSubscriber.html#isDataCollectionEnabled()">isDataCollectionEnabled</a></pre>
+      </div>
+      <div class="api-item"><a name="getSessionSubscriberName()"></a><a name="setSessionSubscriberName()"></a><a name="getSessionSubscriberName--"></a><a name="setSessionSubscriberName--"></a>
+        <h3 class="api-name" id="sessionSubscriberName()">sessionSubscriberName</h3>
+        <pre class="api-signature no-pretty-print">abstract&nbsp;@<a href="https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html">NonNull</a> <a href="/docs/reference/android/com/google/firebase/sessions/api/SessionSubscriber.Name.html">SessionSubscriber.Name</a>&nbsp;<a href="/docs/reference/android/com/google/firebase/sessions/api/SessionSubscriber.html#sessionSubscriberName()">sessionSubscriberName</a></pre>
+      </div>
+    </div>
+    <div class="list">
+      <h2>Public methods</h2>
+      <div class="api-item"><a name="onSessionChanged-com.google.firebase.sessions.api.SessionSubscriber.SessionDetails-"></a><a name="onsessionchanged"></a>
+        <h3 class="api-name" id="onSessionChanged(com.google.firebase.sessions.api.SessionSubscriber.SessionDetails)">onSessionChanged</h3>
+        <pre class="api-signature no-pretty-print">abstract&nbsp;void&nbsp;<a href="/docs/reference/android/com/google/firebase/sessions/api/SessionSubscriber.html#onSessionChanged(com.google.firebase.sessions.api.SessionSubscriber.SessionDetails)">onSessionChanged</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html">NonNull</a> <a href="/docs/reference/android/com/google/firebase/sessions/api/SessionSubscriber.SessionDetails.html">SessionSubscriber.SessionDetails</a>&nbsp;sessionDetails<br>)</pre>
+      </div>
+    </div>
+  </body>
+</html>
+
--- /Users/runner/diff/original/firebase-kotlindoc/android/com/google/firebase/sessions/api/package-summary.html	1970-01-01 00:00:00.000000000 +0000
+++ /Users/runner/diff/modified/firebase-kotlindoc/android/com/google/firebase/sessions/api/package-summary.html	2023-05-12 17:29:02.000000000 +0000
@@ -0,0 +1,68 @@
+<html devsite="true">
+  <head>
+    <title>com.google.firebase.sessions.api</title>
+{% setvar book_path %}/_book.yaml{% endsetvar %}
+{% include "docs/reference/android/_reference-head-tags.html" %}
+  </head>
+  <body>
+    <h1>com.google.firebase.sessions.api</h1>
+    <h2>Interfaces</h2>
+    <div class="devsite-table-wrapper">
+      <table class="responsive">
+        <colgroup>
+          <col width="40%">
+          <col>
+        </colgroup>
+        <tbody class="list">
+          <tr>
+            <td><code><a href="/docs/reference/android/com/google/firebase/sessions/api/SessionSubscriber.html">SessionSubscriber</a></code></td>
+            <td>
+              <p><code><a href="/docs/reference/android/com/google/firebase/sessions/api/SessionSubscriber.html">SessionSubscriber</a></code> is an interface that dependent SDKs must implement.</p>
+            </td>
+          </tr>
+        </tbody>
+      </table>
+    </div>
+    <h2>Classes</h2>
+    <div class="devsite-table-wrapper">
+      <table class="responsive">
+        <colgroup>
+          <col width="40%">
+          <col>
+        </colgroup>
+        <tbody class="list">
+          <tr>
+            <td><code><a href="/docs/reference/android/com/google/firebase/sessions/api/SessionSubscriber.SessionDetails.html">SessionSubscriber.SessionDetails</a></code></td>
+            <td>
+              <p><code><a href="/docs/reference/android/com/google/firebase/sessions/api/SessionSubscriber.SessionDetails.html">SessionDetails</a></code> contains session data passed to subscribers whenever the session changes</p>
+            </td>
+          </tr>
+          <tr>
+            <td><code><a href="/docs/reference/android/com/google/firebase/sessions/api/FirebaseSessionsDependencies.html">FirebaseSessionsDependencies</a></code></td>
+            <td>
+              <p><code><a href="/docs/reference/android/com/google/firebase/sessions/api/FirebaseSessionsDependencies.html">FirebaseSessionsDependencies</a></code> determines when a dependent SDK is installed in the app.</p>
+            </td>
+          </tr>
+        </tbody>
+      </table>
+    </div>
+    <h2>Enums</h2>
+    <div class="devsite-table-wrapper">
+      <table class="responsive">
+        <colgroup>
+          <col width="40%">
+          <col>
+        </colgroup>
+        <tbody class="list">
+          <tr>
+            <td><code><a href="/docs/reference/android/com/google/firebase/sessions/api/SessionSubscriber.Name.html">SessionSubscriber.Name</a></code></td>
+            <td>
+              <p><code><a href="/docs/reference/android/com/google/firebase/sessions/api/SessionSubscriber.Name.html">SessionSubscriber.Name</a></code>s are used for identifying subscribers.</p>
+            </td>
+          </tr>
+        </tbody>
+      </table>
+    </div>
+  </body>
+</html>
+
--- /Users/runner/diff/original/firebase-kotlindoc/kotlin/client/firebase-sessions/_toc.yaml	2023-05-12 17:34:35.000000000 +0000
+++ /Users/runner/diff/modified/firebase-kotlindoc/kotlin/client/firebase-sessions/_toc.yaml	2023-05-12 17:29:02.000000000 +0000
@@ -9,6 +9,34 @@
     - title: "FirebaseSessions"
       path: "/docs/reference/kotlin/com/google/firebase/sessions/FirebaseSessions.html"
 
+- title: "com.google.firebase.sessions.api"
+  path: "/docs/reference/kotlin/com/google/firebase/sessions/api/package-summary.html"
+
+  section:
+  - title: "Interfaces"
+
+    section:
+    - title: "SessionSubscriber"
+      path: "/docs/reference/kotlin/com/google/firebase/sessions/api/SessionSubscriber.html"
+
+  - title: "Classes"
+
+    section:
+    - title: "SessionSubscriber.SessionDetails"
+      path: "/docs/reference/kotlin/com/google/firebase/sessions/api/SessionSubscriber.SessionDetails.html"
+
+  - title: "Enums"
+
+    section:
+    - title: "SessionSubscriber.Name"
+      path: "/docs/reference/kotlin/com/google/firebase/sessions/api/SessionSubscriber.Name.html"
+
+  - title: "Objects"
+
+    section:
+    - title: "FirebaseSessionsDependencies"
+      path: "/docs/reference/kotlin/com/google/firebase/sessions/api/FirebaseSessionsDependencies.html"
+
 - title: "com.google.firebase.sessions.settings"
   path: "/docs/reference/kotlin/com/google/firebase/sessions/settings/package-summary.html"
 
--- /Users/runner/diff/original/firebase-kotlindoc/kotlin/com/google/firebase/sessions/api/FirebaseSessionsDependencies.html	1970-01-01 00:00:00.000000000 +0000
+++ /Users/runner/diff/modified/firebase-kotlindoc/kotlin/com/google/firebase/sessions/api/FirebaseSessionsDependencies.html	2023-05-12 17:29:02.000000000 +0000
@@ -0,0 +1,49 @@
+<html devsite="true">
+  <head>
+    <title>FirebaseSessionsDependencies</title>
+{% setvar book_path %}/_book.yaml{% endsetvar %}
+{% include "docs/reference/kotlin/_reference-head-tags.html" %}
+  </head>
+  <body>
+    <div id="metadata-info-block"></div>
+    <h1>FirebaseSessionsDependencies</h1>
+    <p>
+      <pre>object <a href="/docs/reference/kotlin/com/google/firebase/sessions/api/FirebaseSessionsDependencies.html">FirebaseSessionsDependencies</a></pre>
+    </p>
+    <hr>
+    <p><code><a href="/docs/reference/kotlin/com/google/firebase/sessions/api/FirebaseSessionsDependencies.html">FirebaseSessionsDependencies</a></code> determines when a dependent SDK is installed in the app. The Sessions SDK uses this to figure out which dependencies to wait for to getting the data collection state. This is thread safe.</p>
+    <p>This is important because the Sessions SDK starts up before dependent SDKs.</p>
+    <h2>Summary</h2>
+    <div class="devsite-table-wrapper">
+      <table class="responsive">
+        <colgroup>
+          <col width="40%">
+          <col>
+        </colgroup>
+        <thead>
+          <tr>
+            <th colspan="100%"><h3>Public functions</h3></th>
+          </tr>
+        </thead>
+        <tbody class="list">
+          <tr>
+            <td><code><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a></code></td>
+            <td>
+              <div><code><a href="/docs/reference/kotlin/com/google/firebase/sessions/api/FirebaseSessionsDependencies.html#addDependency(com.google.firebase.sessions.api.SessionSubscriber.Name)">addDependency</a>(subscriberName:&nbsp;<a href="/docs/reference/kotlin/com/google/firebase/sessions/api/SessionSubscriber.Name.html">SessionSubscriber.Name</a>)</code></div>
+              <p>Add a subscriber as a dependency to the Sessions SDK.</p>
+            </td>
+          </tr>
+        </tbody>
+      </table>
+    </div>
+    <div class="list">
+      <h2>Public functions</h2>
+      <div class="api-item"><a name="addDependency-com.google.firebase.sessions.api.SessionSubscriber.Name-"></a><a name="adddependency"></a>
+        <h3 class="api-name" id="addDependency(com.google.firebase.sessions.api.SessionSubscriber.Name)">addDependency</h3>
+        <pre class="api-signature no-pretty-print">fun&nbsp;<a href="/docs/reference/kotlin/com/google/firebase/sessions/api/FirebaseSessionsDependencies.html#addDependency(com.google.firebase.sessions.api.SessionSubscriber.Name)">addDependency</a>(subscriberName:&nbsp;<a href="/docs/reference/kotlin/com/google/firebase/sessions/api/SessionSubscriber.Name.html">SessionSubscriber.Name</a>):&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a></pre>
+        <p>Add a subscriber as a dependency to the Sessions SDK. Every dependency must register itself, or the Sessions SDK will never generate a session.</p>
+      </div>
+    </div>
+  </body>
+</html>
+
--- /Users/runner/diff/original/firebase-kotlindoc/kotlin/com/google/firebase/sessions/api/SessionSubscriber.Name.html	1970-01-01 00:00:00.000000000 +0000
+++ /Users/runner/diff/modified/firebase-kotlindoc/kotlin/com/google/firebase/sessions/api/SessionSubscriber.Name.html	2023-05-12 17:29:02.000000000 +0000
@@ -0,0 +1,134 @@
+<html devsite="true">
+  <head>
+    <title>SessionSubscriber.Name</title>
+{% setvar book_path %}/_book.yaml{% endsetvar %}
+{% include "docs/reference/kotlin/_reference-head-tags.html" %}
+  </head>
+  <body>
+    <div id="metadata-info-block"></div>
+    <h1>SessionSubscriber.Name</h1>
+    <p>
+      <pre>enum <a href="/docs/reference/kotlin/com/google/firebase/sessions/api/SessionSubscriber.Name.html">SessionSubscriber.Name</a> : <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-enum/index.html">Enum</a></pre>
+    </p>
+    <div class="devsite-table-wrapper">
+      <table class="jd-inheritance-table">
+        <tbody>
+          <tr>
+            <td colspan="3"><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html">kotlin.Any</a></td>
+          </tr>
+          <tr>
+            <td class="jd-inheritance-space">&nbsp;&nbsp;&nbsp;↳</td>
+            <td colspan="2"><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-enum/index.html">kotlin.Enum</a></td>
+          </tr>
+          <tr>
+            <td>&nbsp;</td>
+            <td class="jd-inheritance-space">&nbsp;&nbsp;&nbsp;↳</td>
+            <td colspan="1"><a href="/docs/reference/kotlin/com/google/firebase/sessions/api/SessionSubscriber.Name.html">com.google.firebase.sessions.api.SessionSubscriber.Name</a></td>
+          </tr>
+        </tbody>
+      </table>
+    </div>
+    <hr>
+    <p><code><a href="/docs/reference/kotlin/com/google/firebase/sessions/api/SessionSubscriber.Name.html">SessionSubscriber.Name</a></code>s are used for identifying subscribers.</p>
+    <h2>Summary</h2>
+    <div class="devsite-table-wrapper">
+      <table class="responsive">
+        <colgroup>
+          <col width="40%">
+          <col>
+        </colgroup>
+        <thead>
+          <tr>
+            <th colspan="100%"><h3>Enum Values</h3></th>
+          </tr>
+        </thead>
+        <tbody class="list">
+          <tr>
+            <td><code><a href="/docs/reference/kotlin/com/google/firebase/sessions/api/SessionSubscriber.Name.html#CRASHLYTICS">CRASHLYTICS</a></code></td>
+            <td></td>
+          </tr>
+          <tr>
+            <td><code><a href="/docs/reference/kotlin/com/google/firebase/sessions/api/SessionSubscriber.Name.html#PERFORMANCE">PERFORMANCE</a></code></td>
+            <td></td>
+          </tr>
+        </tbody>
+      </table>
+    </div>
+    <div class="devsite-table-wrapper">
+      <table class="responsive">
+        <colgroup>
+          <col width="40%">
+          <col>
+        </colgroup>
+        <thead>
+          <tr>
+            <th colspan="100%"><h3>Public functions</h3></th>
+          </tr>
+        </thead>
+        <tbody class="list">
+          <tr>
+            <td><code><a href="/docs/reference/kotlin/com/google/firebase/sessions/api/SessionSubscriber.Name.html">SessionSubscriber.Name</a></code></td>
+            <td>
+              <div><code><a href="/docs/reference/kotlin/com/google/firebase/sessions/api/SessionSubscriber.Name.html#valueOf(kotlin.String)">valueOf</a>(value:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a>)</code></div>
+              <p>Returns the enum constant of this type with the specified name.</p>
+            </td>
+          </tr>
+          <tr>
+            <td><code><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/index.html">Array</a>&lt;<a href="/docs/reference/kotlin/com/google/firebase/sessions/api/SessionSubscriber.Name.html">SessionSubscriber.Name</a>&gt;</code></td>
+            <td>
+              <div><code><a href="/docs/reference/kotlin/com/google/firebase/sessions/api/SessionSubscriber.Name.html#values()">values</a>()</code></div>
+              <p>Returns an array containing the constants of this enum type, in the order they're declared.</p>
+            </td>
+          </tr>
+        </tbody>
+      </table>
+    </div>
+    <div class="list">
+      <h2>Enum Values</h2>
+      <div class="api-item">
+        <h3 class="api-name" id="CRASHLYTICS">CRASHLYTICS</h3>
+        <pre class="api-signature no-pretty-print">val&nbsp;<a href="/docs/reference/kotlin/com/google/firebase/sessions/api/SessionSubscriber.Name.html#CRASHLYTICS">SessionSubscriber.Name.CRASHLYTICS</a>:&nbsp;<a href="/docs/reference/kotlin/com/google/firebase/sessions/api/SessionSubscriber.Name.html">SessionSubscriber.Name</a></pre>
+      </div>
+      <div class="api-item">
+        <h3 class="api-name" id="PERFORMANCE">PERFORMANCE</h3>
+        <pre class="api-signature no-pretty-print">val&nbsp;<a href="/docs/reference/kotlin/com/google/firebase/sessions/api/SessionSubscriber.Name.html#PERFORMANCE">SessionSubscriber.Name.PERFORMANCE</a>:&nbsp;<a href="/docs/reference/kotlin/com/google/firebase/sessions/api/SessionSubscriber.Name.html">SessionSubscriber.Name</a></pre>
+      </div>
+    </div>
+    <div class="list">
+      <h2>Public functions</h2>
+      <div class="api-item"><a name="valueOf-kotlin.String-"></a><a name="valueof"></a>
+        <h3 class="api-name" id="valueOf(kotlin.String)">valueOf</h3>
+        <pre class="api-signature no-pretty-print">fun&nbsp;<a href="/docs/reference/kotlin/com/google/firebase/sessions/api/SessionSubscriber.Name.html#valueOf(kotlin.String)">valueOf</a>(value:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a>):&nbsp;<a href="/docs/reference/kotlin/com/google/firebase/sessions/api/SessionSubscriber.Name.html">SessionSubscriber.Name</a></pre>
+        <p>Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)</p>
+        <div class="devsite-table-wrapper">
+          <table class="responsive">
+            <colgroup>
+              <col width="40%">
+              <col>
+            </colgroup>
+            <thead>
+              <tr>
+                <th colspan="100%">Throws</th>
+              </tr>
+            </thead>
+            <tbody class="list">
+              <tr>
+                <td><code>kotlin.IllegalArgumentException:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-illegal-argument-exception/index.html">kotlin.IllegalArgumentException</a></code></td>
+                <td>
+                  <p>if this enum type has no constant with the specified name</p>
+                </td>
+              </tr>
+            </tbody>
+          </table>
+        </div>
+      </div>
+      <div class="api-item"><a name="values--"></a><a name="values"></a>
+        <h3 class="api-name" id="values()">values</h3>
+        <pre class="api-signature no-pretty-print">fun&nbsp;<a href="/docs/reference/kotlin/com/google/firebase/sessions/api/SessionSubscriber.Name.html#values()">values</a>():&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/index.html">Array</a>&lt;<a href="/docs/reference/kotlin/com/google/firebase/sessions/api/SessionSubscriber.Name.html">SessionSubscriber.Name</a>&gt;</pre>
+        <p>Returns an array containing the constants of this enum type, in the order they're declared.</p>
+        <p>This method may be used to iterate over the constants.</p>
+      </div>
+    </div>
+  </body>
+</html>
+
--- /Users/runner/diff/original/firebase-kotlindoc/kotlin/com/google/firebase/sessions/api/SessionSubscriber.SessionDetails.html	1970-01-01 00:00:00.000000000 +0000
+++ /Users/runner/diff/modified/firebase-kotlindoc/kotlin/com/google/firebase/sessions/api/SessionSubscriber.SessionDetails.html	2023-05-12 17:29:02.000000000 +0000
@@ -0,0 +1,73 @@
+<html devsite="true">
+  <head>
+    <title>SessionSubscriber.SessionDetails</title>
+{% setvar book_path %}/_book.yaml{% endsetvar %}
+{% include "docs/reference/kotlin/_reference-head-tags.html" %}
+  </head>
+  <body>
+    <div id="metadata-info-block"></div>
+    <h1>SessionSubscriber.SessionDetails</h1>
+    <p>
+      <pre>data class <a href="/docs/reference/kotlin/com/google/firebase/sessions/api/SessionSubscriber.SessionDetails.html">SessionSubscriber.SessionDetails</a></pre>
+    </p>
+    <hr>
+    <p><code><a href="/docs/reference/kotlin/com/google/firebase/sessions/api/SessionSubscriber.SessionDetails.html">SessionDetails</a></code> contains session data passed to subscribers whenever the session changes</p>
+    <h2>Summary</h2>
+    <div class="devsite-table-wrapper">
+      <table class="responsive">
+        <colgroup>
+          <col width="40%">
+          <col>
+        </colgroup>
+        <thead>
+          <tr>
+            <th colspan="100%"><h3>Public constructors</h3></th>
+          </tr>
+        </thead>
+        <tbody class="list">
+          <tr>
+            <td>
+              <div><code><a href="/docs/reference/kotlin/com/google/firebase/sessions/api/SessionSubscriber.SessionDetails.html#SessionDetails(kotlin.String)">SessionDetails</a>(sessionId:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a>)</code></div>
+            </td>
+          </tr>
+        </tbody>
+      </table>
+    </div>
+    <div class="devsite-table-wrapper">
+      <table class="responsive">
+        <colgroup>
+          <col width="40%">
+          <col>
+        </colgroup>
+        <thead>
+          <tr>
+            <th colspan="100%"><h3>Public properties</h3></th>
+          </tr>
+        </thead>
+        <tbody class="list">
+          <tr>
+            <td><code><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a></code></td>
+            <td>
+              <div><code><a href="/docs/reference/kotlin/com/google/firebase/sessions/api/SessionSubscriber.SessionDetails.html#sessionId()">sessionId</a></code></div>
+            </td>
+          </tr>
+        </tbody>
+      </table>
+    </div>
+    <div class="list">
+      <h2>Public constructors</h2>
+      <div class="api-item"><a name="SessionDetails-kotlin.String-"></a><a name="sessiondetails"></a>
+        <h3 class="api-name" id="SessionDetails(kotlin.String)">SessionDetails</h3>
+        <pre class="api-signature no-pretty-print"><a href="/docs/reference/kotlin/com/google/firebase/sessions/api/SessionSubscriber.SessionDetails.html#SessionDetails(kotlin.String)">SessionDetails</a>(sessionId:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a>)</pre>
+      </div>
+    </div>
+    <div class="list">
+      <h2>Public properties</h2>
+      <div class="api-item"><a name="getSessionId()"></a><a name="setSessionId()"></a><a name="getSessionId--"></a><a name="setSessionId--"></a>
+        <h3 class="api-name" id="sessionId()">sessionId</h3>
+        <pre class="api-signature no-pretty-print">val&nbsp;<a href="/docs/reference/kotlin/com/google/firebase/sessions/api/SessionSubscriber.SessionDetails.html#sessionId()">sessionId</a>:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a></pre>
+      </div>
+    </div>
+  </body>
+</html>
+
--- /Users/runner/diff/original/firebase-kotlindoc/kotlin/com/google/firebase/sessions/api/SessionSubscriber.html	1970-01-01 00:00:00.000000000 +0000
+++ /Users/runner/diff/modified/firebase-kotlindoc/kotlin/com/google/firebase/sessions/api/SessionSubscriber.html	2023-05-12 17:29:02.000000000 +0000
@@ -0,0 +1,111 @@
+<html devsite="true">
+  <head>
+    <title>SessionSubscriber</title>
+{% setvar book_path %}/_book.yaml{% endsetvar %}
+{% include "docs/reference/kotlin/_reference-head-tags.html" %}
+  </head>
+  <body>
+    <div id="metadata-info-block"></div>
+    <h1>SessionSubscriber</h1>
+    <p>
+      <pre>interface <a href="/docs/reference/kotlin/com/google/firebase/sessions/api/SessionSubscriber.html">SessionSubscriber</a></pre>
+    </p>
+    <hr>
+    <p><code><a href="/docs/reference/kotlin/com/google/firebase/sessions/api/SessionSubscriber.html">SessionSubscriber</a></code> is an interface that dependent SDKs must implement.</p>
+    <h2>Summary</h2>
+    <div class="devsite-table-wrapper">
+      <table class="responsive">
+        <colgroup>
+          <col width="40%">
+          <col>
+        </colgroup>
+        <thead>
+          <tr>
+            <th colspan="100%"><h3>Nested types</h3></th>
+          </tr>
+        </thead>
+        <tbody class="list">
+          <tr>
+            <td>
+              <div><code>enum <a href="/docs/reference/kotlin/com/google/firebase/sessions/api/SessionSubscriber.Name.html">SessionSubscriber.Name</a> : <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-enum/index.html">Enum</a></code></div>
+              <p><code><a href="/docs/reference/kotlin/com/google/firebase/sessions/api/SessionSubscriber.Name.html">SessionSubscriber.Name</a></code>s are used for identifying subscribers.</p>
+            </td>
+          </tr>
+          <tr>
+            <td>
+              <div><code>data class <a href="/docs/reference/kotlin/com/google/firebase/sessions/api/SessionSubscriber.SessionDetails.html">SessionSubscriber.SessionDetails</a></code></div>
+              <p><code><a href="/docs/reference/kotlin/com/google/firebase/sessions/api/SessionSubscriber.SessionDetails.html">SessionDetails</a></code> contains session data passed to subscribers whenever the session changes</p>
+            </td>
+          </tr>
+        </tbody>
+      </table>
+    </div>
+    <div class="devsite-table-wrapper">
+      <table class="responsive">
+        <colgroup>
+          <col width="40%">
+          <col>
+        </colgroup>
+        <thead>
+          <tr>
+            <th colspan="100%"><h3>Public functions</h3></th>
+          </tr>
+        </thead>
+        <tbody class="list">
+          <tr>
+            <td><code><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a></code></td>
+            <td>
+              <div><code><a href="/docs/reference/kotlin/com/google/firebase/sessions/api/SessionSubscriber.html#onSessionChanged(com.google.firebase.sessions.api.SessionSubscriber.SessionDetails)">onSessionChanged</a>(sessionDetails:&nbsp;<a href="/docs/reference/kotlin/com/google/firebase/sessions/api/SessionSubscriber.SessionDetails.html">SessionSubscriber.SessionDetails</a>)</code></div>
+            </td>
+          </tr>
+        </tbody>
+      </table>
+    </div>
+    <div class="devsite-table-wrapper">
+      <table class="responsive">
+        <colgroup>
+          <col width="40%">
+          <col>
+        </colgroup>
+        <thead>
+          <tr>
+            <th colspan="100%"><h3>Public properties</h3></th>
+          </tr>
+        </thead>
+        <tbody class="list">
+          <tr>
+            <td><code><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html">Boolean</a></code></td>
+            <td>
+              <div><code><a href="/docs/reference/kotlin/com/google/firebase/sessions/api/SessionSubscriber.html#isDataCollectionEnabled()">isDataCollectionEnabled</a></code></div>
+            </td>
+          </tr>
+          <tr>
+            <td><code><a href="/docs/reference/kotlin/com/google/firebase/sessions/api/SessionSubscriber.Name.html">SessionSubscriber.Name</a></code></td>
+            <td>
+              <div><code><a href="/docs/reference/kotlin/com/google/firebase/sessions/api/SessionSubscriber.html#sessionSubscriberName()">sessionSubscriberName</a></code></div>
+            </td>
+          </tr>
+        </tbody>
+      </table>
+    </div>
+    <div class="list">
+      <h2>Public functions</h2>
+      <div class="api-item"><a name="onSessionChanged-com.google.firebase.sessions.api.SessionSubscriber.SessionDetails-"></a><a name="onsessionchanged"></a>
+        <h3 class="api-name" id="onSessionChanged(com.google.firebase.sessions.api.SessionSubscriber.SessionDetails)">onSessionChanged</h3>
+        <pre class="api-signature no-pretty-print">fun&nbsp;<a href="/docs/reference/kotlin/com/google/firebase/sessions/api/SessionSubscriber.html#onSessionChanged(com.google.firebase.sessions.api.SessionSubscriber.SessionDetails)">onSessionChanged</a>(sessionDetails:&nbsp;<a href="/docs/reference/kotlin/com/google/firebase/sessions/api/SessionSubscriber.SessionDetails.html">SessionSubscriber.SessionDetails</a>):&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a></pre>
+      </div>
+    </div>
+    <div class="list">
+      <h2>Public properties</h2>
+      <div class="api-item"><a name="getIsDataCollectionEnabled()"></a><a name="setIsDataCollectionEnabled()"></a><a name="getIsDataCollectionEnabled--"></a><a name="setIsDataCollectionEnabled--"></a>
+        <h3 class="api-name" id="isDataCollectionEnabled()">isDataCollectionEnabled</h3>
+        <pre class="api-signature no-pretty-print">val&nbsp;<a href="/docs/reference/kotlin/com/google/firebase/sessions/api/SessionSubscriber.html#isDataCollectionEnabled()">isDataCollectionEnabled</a>:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html">Boolean</a></pre>
+      </div>
+      <div class="api-item"><a name="getSessionSubscriberName()"></a><a name="setSessionSubscriberName()"></a><a name="getSessionSubscriberName--"></a><a name="setSessionSubscriberName--"></a>
+        <h3 class="api-name" id="sessionSubscriberName()">sessionSubscriberName</h3>
+        <pre class="api-signature no-pretty-print">val&nbsp;<a href="/docs/reference/kotlin/com/google/firebase/sessions/api/SessionSubscriber.html#sessionSubscriberName()">sessionSubscriberName</a>:&nbsp;<a href="/docs/reference/kotlin/com/google/firebase/sessions/api/SessionSubscriber.Name.html">SessionSubscriber.Name</a></pre>
+      </div>
+    </div>
+  </body>
+</html>
+
--- /Users/runner/diff/original/firebase-kotlindoc/kotlin/com/google/firebase/sessions/api/package-summary.html	1970-01-01 00:00:00.000000000 +0000
+++ /Users/runner/diff/modified/firebase-kotlindoc/kotlin/com/google/firebase/sessions/api/package-summary.html	2023-05-12 17:29:02.000000000 +0000
@@ -0,0 +1,79 @@
+<html devsite="true">
+  <head>
+    <title>com.google.firebase.sessions.api</title>
+{% setvar book_path %}/_book.yaml{% endsetvar %}
+{% include "docs/reference/kotlin/_reference-head-tags.html" %}
+  </head>
+  <body>
+    <h1>com.google.firebase.sessions.api</h1>
+    <h2>Interfaces</h2>
+    <div class="devsite-table-wrapper">
+      <table class="responsive">
+        <colgroup>
+          <col width="40%">
+          <col>
+        </colgroup>
+        <tbody class="list">
+          <tr>
+            <td><code><a href="/docs/reference/kotlin/com/google/firebase/sessions/api/SessionSubscriber.html">SessionSubscriber</a></code></td>
+            <td>
+              <p><code><a href="/docs/reference/kotlin/com/google/firebase/sessions/api/SessionSubscriber.html">SessionSubscriber</a></code> is an interface that dependent SDKs must implement.</p>
+            </td>
+          </tr>
+        </tbody>
+      </table>
+    </div>
+    <h2>Classes</h2>
+    <div class="devsite-table-wrapper">
+      <table class="responsive">
+        <colgroup>
+          <col width="40%">
+          <col>
+        </colgroup>
+        <tbody class="list">
+          <tr>
+            <td><code><a href="/docs/reference/kotlin/com/google/firebase/sessions/api/SessionSubscriber.SessionDetails.html">SessionSubscriber.SessionDetails</a></code></td>
+            <td>
+              <p><code><a href="/docs/reference/kotlin/com/google/firebase/sessions/api/SessionSubscriber.SessionDetails.html">SessionDetails</a></code> contains session data passed to subscribers whenever the session changes</p>
+            </td>
+          </tr>
+        </tbody>
+      </table>
+    </div>
+    <h2>Objects</h2>
+    <div class="devsite-table-wrapper">
+      <table class="responsive">
+        <colgroup>
+          <col width="40%">
+          <col>
+        </colgroup>
+        <tbody class="list">
+          <tr>
+            <td><code><a href="/docs/reference/kotlin/com/google/firebase/sessions/api/FirebaseSessionsDependencies.html">FirebaseSessionsDependencies</a></code></td>
+            <td>
+              <p><code><a href="/docs/reference/kotlin/com/google/firebase/sessions/api/FirebaseSessionsDependencies.html">FirebaseSessionsDependencies</a></code> determines when a dependent SDK is installed in the app.</p>
+            </td>
+          </tr>
+        </tbody>
+      </table>
+    </div>
+    <h2>Enums</h2>
+    <div class="devsite-table-wrapper">
+      <table class="responsive">
+        <colgroup>
+          <col width="40%">
+          <col>
+        </colgroup>
+        <tbody class="list">
+          <tr>
+            <td><code><a href="/docs/reference/kotlin/com/google/firebase/sessions/api/SessionSubscriber.Name.html">SessionSubscriber.Name</a></code></td>
+            <td>
+              <p><code><a href="/docs/reference/kotlin/com/google/firebase/sessions/api/SessionSubscriber.Name.html">SessionSubscriber.Name</a></code>s are used for identifying subscribers.</p>
+            </td>
+          </tr>
+        </tbody>
+      </table>
+    </div>
+  </body>
+</html>
+

@google-oss-bot
Copy link
Contributor

Startup Time Report 1

Note: Layout is sometimes suboptimal due to limited formatting support on GitHub. Please check this report on GCS.

Startup time comparison between the CI merge commit (01b1a4b) and the base commit (d4a30e1) are not available.

No macrobenchmark data found for the base commit (d4a30e1). Analysis for the CI merge commit (01b1a4b) can be found at:

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

Copy link
Contributor

@visumickey visumickey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm slightly confused with the sequence of operations here:

  1. Who would call addDependency? Is it the dependency like Crashlytics/Fireperf?
  2. Who would call register? I presume it is the dependency. Correct me if I'm wrong
  3. Why is there a mutex lock on dependency between addDependency and Register?

@mrober
Copy link
Contributor Author

mrober commented May 10, 2023

I'm slightly confused with the sequence of operations here:

  1. Who would call addDependency? Is it the dependency like Crashlytics/Fireperf?
  2. Who would call register? I presume it is the dependency. Correct me if I'm wrong
  3. Why is there a mutex lock on dependency between addDependency and Register?
  1. A product SDK will add itself as a dependency when its class is loaded into memory. This will tell Sessions to wait for that dependency to be registered before generating a session.
  2. The product SDK will then register itself after it has initialized. This means the prodicut able to tell if data collection is enabled, is ready to receive a onSessionChanged, etc.
  3. The mutex is locked for a product dependency until it has registered itself. Only when the mutex has been unlocked can Sessions check if data collection is enabled for that product. This is similar to how iOS does it with Promises, but we can take advantage of Kotlin's coroutines to do this in this easier way.

See go/aqs-android-product-integration and #4993 for an example of how it looks.

Copy link
Contributor

@visumickey visumickey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good to me. Just waiting for the naming of the functions to change to approving it.


private fun getDependency(subscriberName: SessionSubscriber.Name): Dependency {
return dependencies.getOrElse(subscriberName) {
throw IllegalStateException(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, a late nit pick: Should this throw an exception? Can we get away with a Log message? Basically when this exception occurs for a developers, there is nothing he would be able to fix it. So, thinking if this should be converted to a log message.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried making this nullable, but it is pretty ugly to deal with nulls through this class. If the dependency hasn't been added then getSubscriber will end up throwing anyway, just with a less useful message. I intend this exception to help the 1P developer integrate a Firebase product with Sessions in the future.

@mrober mrober merged commit 97675ee into firebase-sessions May 12, 2023
@mrober mrober deleted the sessions-deps branch May 12, 2023 18:55
@firebase firebase locked and limited conversation to collaborators Jun 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants