Skip to content
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

Ensure the settings cache has loaded from disk before reading any values #5103

Merged
merged 6 commits into from
Jun 26, 2023

Conversation

mrober
Copy link
Contributor

@mrober mrober commented Jun 23, 2023

This also adds some resilience to settings, handling failure cases better, and validating setting values.

# Conflicts:
#	firebase-sessions/src/main/kotlin/com/google/firebase/sessions/settings/RemoteSettings.kt
#	firebase-sessions/src/test/kotlin/com/google/firebase/sessions/RemoteSettingsTest.kt
#	firebase-sessions/src/test/kotlin/com/google/firebase/sessions/SessionsSettingsTest.kt
#	firebase-sessions/src/test/kotlin/com/google/firebase/sessions/SettingsCacheTest.kt
@google-oss-bot
Copy link
Contributor

google-oss-bot commented Jun 23, 2023

Coverage Report 1

Affected Products

  • firebase-sessions

    Overall coverage changed from ? (5191689) to 71.04% (681baf2) by ?.

    20 individual files with coverage change

    FilenameBase (5191689)Merge (681baf2)Diff
    ApplicationInfo.kt?100.00%?
    AutoSessionEventEncoder.java?100.00%?
    EventGDTLogger.kt?75.00%?
    FirebaseSessions.kt?0.00%?
    FirebaseSessionsDependencies.kt?91.30%?
    FirebaseSessionsRegistrar.kt?0.00%?
    LocalOverrideSettings.kt?83.33%?
    RemoteSettings.kt?84.51%?
    RemoteSettingsFetcher.kt?65.85%?
    SessionCoordinator.kt?75.00%?
    SessionEvent.kt?100.00%?
    SessionEvents.kt?96.97%?
    SessionGenerator.kt?91.67%?
    SessionInitiateListener.kt?0.00%?
    SessionInitiator.kt?74.19%?
    SessionsSettings.kt?70.45%?
    SessionSubscriber.kt?75.00%?
    SettingsCache.kt?86.21%?
    SettingsProvider.kt?50.00%?
    Time.kt?0.00%?

Test Logs

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

@github-actions
Copy link
Contributor

github-actions bot commented Jun 23, 2023

Unit Test Results

   128 files     128 suites   3m 48s ⏱️
1 027 tests 1 027 ✔️ 0 💤 0
2 054 runs  2 054 ✔️ 0 💤 0

Results for commit b8e6e76.

♻️ This comment has been updated with latest results.

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Jun 23, 2023

Size Report 1

Affected Products

  • base

    TypeBase (5191689)Merge (681baf2)Diff
    apk (aggressive)?8.39 kB? (?)
    apk (release)?8.66 kB? (?)
  • firebase-sessions

    TypeBase (5191689)Merge (681baf2)Diff
    aar?106 kB? (?)
    apk (aggressive)?363 kB? (?)
    apk (release)?2.06 MB? (?)

Test Logs

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

@github-actions
Copy link
Contributor

github-actions bot commented Jun 23, 2023

Javadoc Changes:
--- /Users/runner/diff/original/firebase-kotlindoc/android/client/firebase-sessions/_toc.yaml	2023-06-26 15:16:11.000000000 +0000
+++ /Users/runner/diff/modified/firebase-kotlindoc/android/client/firebase-sessions/_toc.yaml	2023-06-26 15:10:32.000000000 +0000
@@ -33,14 +33,4 @@
     - 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"
-
-  section:
-  - title: "Interfaces"
-
-    section:
-    - title: "SettingsProvider"
-      path: "/docs/reference/android/com/google/firebase/sessions/settings/SettingsProvider.html"
-
 
--- /Users/runner/diff/original/firebase-kotlindoc/android/com/google/firebase/sessions/settings/SettingsProvider.html	2023-06-26 15:16:11.000000000 +0000
+++ /Users/runner/diff/modified/firebase-kotlindoc/android/com/google/firebase/sessions/settings/SettingsProvider.html	1970-01-01 00:00:00.000000000 +0000
@@ -1,103 +0,0 @@
-<html devsite="true">
-  <head>
-    <title>SettingsProvider</title>
-{% setvar book_path %}/_book.yaml{% endsetvar %}
-{% include "docs/reference/android/_reference-head-tags.html" %}
-  </head>
-  <body>
-    <div id="metadata-info-block"></div>
-    <h1>SettingsProvider</h1>
-    <p>
-      <pre>public interface <a href="/docs/reference/android/com/google/firebase/sessions/settings/SettingsProvider.html">SettingsProvider</a></pre>
-    </p>
-    <hr>
-    <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>abstract <a href="https://developer.android.com/reference/kotlin/java/lang/Double.html">Double</a></code></td>
-            <td>
-              <div><code><a href="/docs/reference/android/com/google/firebase/sessions/settings/SettingsProvider.html#samplingRate()">samplingRate</a></code></div>
-            </td>
-          </tr>
-          <tr>
-            <td><code>abstract <a href="https://developer.android.com/reference/kotlin/java/lang/Boolean.html">Boolean</a></code></td>
-            <td>
-              <div><code><a href="/docs/reference/android/com/google/firebase/sessions/settings/SettingsProvider.html#sessionEnabled()">sessionEnabled</a></code></div>
-            </td>
-          </tr>
-          <tr>
-            <td><code>abstract <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.time/-duration/index.html">Duration</a></code></td>
-            <td>
-              <div><code><a href="/docs/reference/android/com/google/firebase/sessions/settings/SettingsProvider.html#sessionRestartTimeout()">sessionRestartTimeout</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 boolean</code></td>
-            <td>
-              <div><code><a href="/docs/reference/android/com/google/firebase/sessions/settings/SettingsProvider.html#isSettingsStale()">isSettingsStale</a>()</code></div>
-            </td>
-          </tr>
-          <tr>
-            <td><code>abstract void</code></td>
-            <td>
-              <div><code><a href="/docs/reference/android/com/google/firebase/sessions/settings/SettingsProvider.html#updateSettings()">updateSettings</a>()</code></div>
-            </td>
-          </tr>
-        </tbody>
-      </table>
-    </div>
-    <div class="list">
-      <h2>Public fields</h2>
-      <div class="api-item"><a name="getSamplingRate()"></a><a name="setSamplingRate()"></a><a name="getSamplingRate--"></a><a name="setSamplingRate--"></a>
-        <h3 class="api-name" id="samplingRate()">samplingRate</h3>
-        <pre class="api-signature no-pretty-print">abstract&nbsp;<a href="https://developer.android.com/reference/kotlin/java/lang/Double.html">Double</a>&nbsp;<a href="/docs/reference/android/com/google/firebase/sessions/settings/SettingsProvider.html#samplingRate()">samplingRate</a></pre>
-      </div>
-      <div class="api-item"><a name="getSessionEnabled()"></a><a name="setSessionEnabled()"></a><a name="getSessionEnabled--"></a><a name="setSessionEnabled--"></a>
-        <h3 class="api-name" id="sessionEnabled()">sessionEnabled</h3>
-        <pre class="api-signature no-pretty-print">abstract&nbsp;<a href="https://developer.android.com/reference/kotlin/java/lang/Boolean.html">Boolean</a>&nbsp;<a href="/docs/reference/android/com/google/firebase/sessions/settings/SettingsProvider.html#sessionEnabled()">sessionEnabled</a></pre>
-      </div>
-      <div class="api-item"><a name="getSessionRestartTimeout()"></a><a name="setSessionRestartTimeout()"></a><a name="getSessionRestartTimeout--"></a><a name="setSessionRestartTimeout--"></a>
-        <h3 class="api-name" id="sessionRestartTimeout()">sessionRestartTimeout</h3>
-        <pre class="api-signature no-pretty-print">abstract&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.time/-duration/index.html">Duration</a>&nbsp;<a href="/docs/reference/android/com/google/firebase/sessions/settings/SettingsProvider.html#sessionRestartTimeout()">sessionRestartTimeout</a></pre>
-      </div>
-    </div>
-    <div class="list">
-      <h2>Public methods</h2>
-      <div class="api-item"><a name="isSettingsStale--"></a><a name="issettingsstale"></a>
-        <h3 class="api-name" id="isSettingsStale()">isSettingsStale</h3>
-        <pre class="api-signature no-pretty-print">abstract&nbsp;boolean&nbsp;<a href="/docs/reference/android/com/google/firebase/sessions/settings/SettingsProvider.html#isSettingsStale()">isSettingsStale</a>()</pre>
-      </div>
-      <div class="api-item"><a name="updateSettings--"></a><a name="updatesettings"></a>
-        <h3 class="api-name" id="updateSettings()">updateSettings</h3>
-        <pre class="api-signature no-pretty-print">abstract&nbsp;void&nbsp;<a href="/docs/reference/android/com/google/firebase/sessions/settings/SettingsProvider.html#updateSettings()">updateSettings</a>()</pre>
-      </div>
-    </div>
-  </body>
-</html>
-
--- /Users/runner/diff/original/firebase-kotlindoc/android/com/google/firebase/sessions/settings/package-summary.html	2023-06-26 15:16:11.000000000 +0000
+++ /Users/runner/diff/modified/firebase-kotlindoc/android/com/google/firebase/sessions/settings/package-summary.html	1970-01-01 00:00:00.000000000 +0000
@@ -1,26 +0,0 @@
-<html devsite="true">
-  <head>
-    <title>com.google.firebase.sessions.settings</title>
-{% setvar book_path %}/_book.yaml{% endsetvar %}
-{% include "docs/reference/android/_reference-head-tags.html" %}
-  </head>
-  <body>
-    <h1>com.google.firebase.sessions.settings</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/settings/SettingsProvider.html">SettingsProvider</a></code></td>
-            <td></td>
-          </tr>
-        </tbody>
-      </table>
-    </div>
-  </body>
-</html>
-
--- /Users/runner/diff/original/firebase-kotlindoc/kotlin/client/firebase-sessions/_toc.yaml	2023-06-26 15:16:11.000000000 +0000
+++ /Users/runner/diff/modified/firebase-kotlindoc/kotlin/client/firebase-sessions/_toc.yaml	2023-06-26 15:10:32.000000000 +0000
@@ -37,14 +37,4 @@
     - 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"
-
-  section:
-  - title: "Interfaces"
-
-    section:
-    - title: "SettingsProvider"
-      path: "/docs/reference/kotlin/com/google/firebase/sessions/settings/SettingsProvider.html"
-
 
--- /Users/runner/diff/original/firebase-kotlindoc/kotlin/com/google/firebase/sessions/settings/SettingsProvider.html	2023-06-26 15:16:11.000000000 +0000
+++ /Users/runner/diff/modified/firebase-kotlindoc/kotlin/com/google/firebase/sessions/settings/SettingsProvider.html	1970-01-01 00:00:00.000000000 +0000
@@ -1,103 +0,0 @@
-<html devsite="true">
-  <head>
-    <title>SettingsProvider</title>
-{% setvar book_path %}/_book.yaml{% endsetvar %}
-{% include "docs/reference/kotlin/_reference-head-tags.html" %}
-  </head>
-  <body>
-    <div id="metadata-info-block"></div>
-    <h1>SettingsProvider</h1>
-    <p>
-      <pre>interface <a href="/docs/reference/kotlin/com/google/firebase/sessions/settings/SettingsProvider.html">SettingsProvider</a></pre>
-    </p>
-    <hr>
-    <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/-boolean/index.html">Boolean</a></code></td>
-            <td>
-              <div><code><a href="/docs/reference/kotlin/com/google/firebase/sessions/settings/SettingsProvider.html#isSettingsStale()">isSettingsStale</a>()</code></div>
-            </td>
-          </tr>
-          <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/settings/SettingsProvider.html#updateSettings()">updateSettings</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/-double/index.html">Double</a>?</code></td>
-            <td>
-              <div><code><a href="/docs/reference/kotlin/com/google/firebase/sessions/settings/SettingsProvider.html#samplingRate()">samplingRate</a></code></div>
-            </td>
-          </tr>
-          <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/settings/SettingsProvider.html#sessionEnabled()">sessionEnabled</a></code></div>
-            </td>
-          </tr>
-          <tr>
-            <td><code><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.time/-duration/index.html">Duration</a>?</code></td>
-            <td>
-              <div><code><a href="/docs/reference/kotlin/com/google/firebase/sessions/settings/SettingsProvider.html#sessionRestartTimeout()">sessionRestartTimeout</a></code></div>
-            </td>
-          </tr>
-        </tbody>
-      </table>
-    </div>
-    <div class="list">
-      <h2>Public functions</h2>
-      <div class="api-item"><a name="isSettingsStale--"></a><a name="issettingsstale"></a>
-        <h3 class="api-name" id="isSettingsStale()">isSettingsStale</h3>
-        <pre class="api-signature no-pretty-print">fun&nbsp;<a href="/docs/reference/kotlin/com/google/firebase/sessions/settings/SettingsProvider.html#isSettingsStale()">isSettingsStale</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="updateSettings--"></a><a name="updatesettings"></a>
-        <h3 class="api-name" id="updateSettings()">updateSettings</h3>
-        <pre class="api-signature no-pretty-print">fun&nbsp;<a href="/docs/reference/kotlin/com/google/firebase/sessions/settings/SettingsProvider.html#updateSettings()">updateSettings</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="getSamplingRate()"></a><a name="setSamplingRate()"></a><a name="getSamplingRate--"></a><a name="setSamplingRate--"></a>
-        <h3 class="api-name" id="samplingRate()">samplingRate</h3>
-        <pre class="api-signature no-pretty-print">val&nbsp;<a href="/docs/reference/kotlin/com/google/firebase/sessions/settings/SettingsProvider.html#samplingRate()">samplingRate</a>:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html">Double</a>?</pre>
-      </div>
-      <div class="api-item"><a name="getSessionEnabled()"></a><a name="setSessionEnabled()"></a><a name="getSessionEnabled--"></a><a name="setSessionEnabled--"></a>
-        <h3 class="api-name" id="sessionEnabled()">sessionEnabled</h3>
-        <pre class="api-signature no-pretty-print">val&nbsp;<a href="/docs/reference/kotlin/com/google/firebase/sessions/settings/SettingsProvider.html#sessionEnabled()">sessionEnabled</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="getSessionRestartTimeout()"></a><a name="setSessionRestartTimeout()"></a><a name="getSessionRestartTimeout--"></a><a name="setSessionRestartTimeout--"></a>
-        <h3 class="api-name" id="sessionRestartTimeout()">sessionRestartTimeout</h3>
-        <pre class="api-signature no-pretty-print">val&nbsp;<a href="/docs/reference/kotlin/com/google/firebase/sessions/settings/SettingsProvider.html#sessionRestartTimeout()">sessionRestartTimeout</a>:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.time/-duration/index.html">Duration</a>?</pre>
-      </div>
-    </div>
-  </body>
-</html>
-
--- /Users/runner/diff/original/firebase-kotlindoc/kotlin/com/google/firebase/sessions/settings/package-summary.html	2023-06-26 15:16:11.000000000 +0000
+++ /Users/runner/diff/modified/firebase-kotlindoc/kotlin/com/google/firebase/sessions/settings/package-summary.html	1970-01-01 00:00:00.000000000 +0000
@@ -1,26 +0,0 @@
-<html devsite="true">
-  <head>
-    <title>com.google.firebase.sessions.settings</title>
-{% setvar book_path %}/_book.yaml{% endsetvar %}
-{% include "docs/reference/kotlin/_reference-head-tags.html" %}
-  </head>
-  <body>
-    <h1>com.google.firebase.sessions.settings</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/settings/SettingsProvider.html">SettingsProvider</a></code></td>
-            <td></td>
-          </tr>
-        </tbody>
-      </table>
-    </div>
-  </body>
-</html>
-

context.packageName,
PackageManager.GET_META_DATA,
)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we encapsulate this if statement? To me seeing an if statement with a hanging .metaData makes it hard to read what we're getting the .metaData from

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's a bit hard to clean this up because if I do any other than inline everything like this, I run into https://youtrack.jetbrains.com/issue/KT-53650

I tried to make it clearer, I moved the .metaData inside the if and else bodies, and added a comment for the default value.

@@ -81,6 +78,7 @@ internal class RemoteSettings(

fetchInProgress.set(true)

// TODO(mrober): Avoid sending the fid here, and avoid fetching it when data collection is off.
Copy link
Contributor

Choose a reason for hiding this comment

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

Ok so I looked in the iOS SDK - the way we handle this is just not kicking off the fetch unless we start sending events. So like where we log the event to FireLog is where we'd also kick off settings fetch (but settings must happen before we check the sampling rate)

In the iOS SDK there's a separate method for fetching settings and reading from the cache. Reading from the cache always happens, but fetching happens only when we're cleared to send events

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 did something very similar in #5107

Copy link
Contributor

@samedson samedson left a comment

Choose a reason for hiding this comment

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

Had some suggestions but want to unblock this

@mrober mrober merged commit 2f30231 into firebase-sessions Jun 26, 2023
@mrober mrober deleted the sessions-settings-async-remote branch June 26, 2023 15:42
mrober added a commit that referenced this pull request Jun 26, 2023
* Initial commit for Firebase Sessions SDK (#4713)

* Initial commit for Firebase Sessions SDK

* Add copyright notice

* Remove redundant dependency

* Revert 'Remove redundant dependency' to avoid using api

* Generate api.txt file

* Implement SessionInitiator and hook it up to lifecycle events (#4723)

* Implement SessionInitiator and hook it up to lifecycle events

* Add a warning when failed to register lifecycle callbacks

* Fix formatting

* Use kotlin.time.Duration instead of Long for time intervals (#4733)

* Use kotlin.time.Duration instead of Long for time intervals

* Adjust test constants

* Simplify elapsedRealtime to always be millis precision

* Add SessionGenerator to generate the Session ID (#4747)

* Add SessionEvent data class (#4763)

* Add SessionEvent data class

* Add enum test case

* Remove serialization (this will be handled in encoders) and rename SessionState

* Generate a SessionEvent based on the SessionState

* Rename SessionState to SessionDetails

* Firebase Session Event

* Add Firebase Sessions Test App (#4775)

* Add Firebase Sessions Test App

* Remove boilerplate

* Add JSON encoder for SessionEvents (#4778)

* Use the private setter pattern on SessionGenerator.currentSession (#4785)

* Use the private setter pattern on SessionGenerator.currentSession

* Comments

* Integrate with FirebaseInstallations. (#4796)

* Populate firebaseInstallationId field in session (#4801)

* Package session start event's application information. (#4829)

* Fix workflows for Firebase Sessions (#4841)

* Use googleServices.gradle

* Move package level function to object to fix api surface check

* Add android manifest file with versionName set to fix android tests

* Update pinned deps

* Make getApplicationInfo look leaner

* Setup configuration layer for the library. (#4853)

* Fix Firebase Sessions test app temporarily (#4858)

* Add GDT to Firebase Sessions (#4851)

* Add README files (#4857)

* Fix test app and add README's

* Undo app changes

* Undo app changes

* Add description and formatting to README file

* Add google-services.json file to unit tests (#4868)

* Setup sessions e2e workflow (#4859)

* Start setting up sessions e2e workflow

* Remove schedule

* Format

* Setup gcloud

* Set FIREBASE_APP_CHECK_DEBUG_SECRET

* Set FTL_RESULTS_BUCKET

* Add schedule

* Add 20 min

* Implement local manifest override configs (#4877)

* Fix encoding for Session Events (#4870)

* Use test app for Sessions e2e test (#4881)

* Use test app for Sessions e2e test

* Add test lab plugin

* Use firebase-sessions branch

* Increase time to log session to 60 seconds

* Move currentTimeUs into WallClock (#4890)

* Populate sampling rate in session event (#4891)

* Populate sampling rate in session event

* Fix test

* Fix merge

* Add TimeProvider interface to abstract away the clock (#4905)

* Add TimeProvider interface to abstract away the clock

* Add comment about default elapsed time being zero

* Fill in device_model field for AQS (#4892)

* Implement sampling (#4896)

* Implement sampling

* return

* Remove collectEvents from SessionDetails, use sessionGenerator.collectEvents

* Don't generate whole Session Start event for sampled event

* Fix log message

* Add Sessions to benchmark config (#4914)

* Introduce remote config cache for storing configs fetched remotely. (#4917)

* Make logging consistent with Apple SDK (#4919)

* Pass a CoroutineContext, not CoroutineDispatcher, to SessionCoordinator (#4950)

* Implement remote config fetcher to fetch and cache configs. (#4967)

* Add os_version, app_build_version, device_manufacturer for Sessions #11222 (#4984)

* Add App information for config fetching. (#4992)

* Update the header params for network request. (#4995)

* Add thread safe FirebaseSessionsDependencies (#4983)

* Add thread safe FirebaseSessionsDependencies

* Remove debug line

* Format

* Address comments

* Rename to getRegisteredSubscribers

* Add register api to FirebaseSessions so products can integrate (#4989)

* Add thread safe FirebaseSessionsDependencies

* Remove debug line

* Format

* Add register api to FirebaseSessions so products can integrate

* Fix Android tests and api txt file

* Address comments

* Address comments

* Rename to getRegisteredSubscribers

* Fix callsite

* Add Sessions to Crashlytics (#4993)

* Add thread safe FirebaseSessionsDependencies

* Remove debug line

* Format

* Add register api to FirebaseSessions so products can integrate

* Fix Android tests and api txt file

* Add Sessions to Crashlytics

* Address comments

* Address comments

* Rename to getRegisteredSubscribers

* Fix callsite

* Add todo

* Fix gradle command in README

* Use firebase-encoders-processor instead of manually building encoder (#5030)

* Fix behaviour with multiple subscribers (#5031)

* Fix behaviour with multiple subscribers

* Fix format

* Integrate Firebase Performance with Firebase Sessions. (#5020)

* Clean up how we launch suspend functions (#5028)

* Make `initiateSessionStart` a suspend function

* Notify subscribers regardless of sampling and data collection state

* Add timestamp to SessionDetails

* Fix format

* Generate the session details on main thread

* Fix tests

* Call it sessionStartTimestampUs for clarity sake

* Add and populate appQualitySessionId in Crashlytics reports (#5045)

* Add and populate appQualitySessionId in Crashlytics reports

* Bump Crashlytics ktx target sdk to 33, same as Java sdk

* Log warning when missing AQS session id

* Pin firebase-datatransport version (#5070)

* Use AQS provided sessionId for Fireperf events. (#5060)

* Fix firebase-crashlytics-ktx instrumented tests (#5068)

* Fix firebase-crashlytics-ktx deps

* Fix CrashlyticsTests and clean up build file

* Make FirebaseCrashlyticsKtxRegistrar internal

* Bump health metrics compile sdk

* Add versionName version

* Add check if Sessions is disabled (#5061)

* Do not send session id to subscribers if Sessions is disabled

* Move the Sessions settings disabled check to after subscrubers

* Add fid to Crashlytics report (#5052)

* Add fid to Crashlytics report

* Format

* Handle IOExceptions when fetching remote settings (#5092)

* Handle IOExceptions went fetching remote settings

* Add failure test case for RemoteSettingsFetcher

* Make remote settings fetch non-blocking (#5095)

* Ensure the settings cache has loaded from disk before reading any values (#5103)

* Make remote settings fetch non-blocking

* Ensure the settings cache has loaded from disk before reading any values

* Fix runtime exception with a load-bearing empty block

* Inline the definition of metadata to avoid needing an empty block

* Comments

* Fetch remote settings on session, not on launch (#5107)

* Make remote settings fetch non-blocking

* Ensure the settings cache has loaded from disk before reading any values

* Fix runtime exception with a load-bearing empty block

* Inline the definition of metadata to avoid needing an empty block

* Fetch remote settings on session, not on launch

* Log warning when we fail to fetch the fid

---------

Co-authored-by: Sam Edson <samedson@google.com>
Co-authored-by: Visu <visumickey@gmail.com>
@firebase firebase locked and limited conversation to collaborators Jul 27, 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.

3 participants