Skip to content

Conversation

mrober
Copy link
Contributor

@mrober mrober commented Mar 7, 2025

Use Dagger for dependency injection in Sessions.

This follows Firebase best practices, see https://firebase.github.io/firebase-android-sdk/best_practices/dependency_injection. Also, reducing the number of Firebase Components improves initializing time.

This is mostly just the scaffolding. Some of the classes and interfaces are still a little awkward, they can be cleaned up later. The @Background and @Blocking executors are now enforced by Dagger, making them less error prone. The unit tests still need to be updated, right now they still rely on the old Firebase Components model to inject fake dependencies, I just added a Dagger component to bridge them instead of refactoring, that can be done later too.

Singletons are now enforced by Dagger, also making the code less error prone.

Copy link
Contributor

github-actions bot commented Mar 7, 2025

📝 PRs merging into main branch

Our main branch should always be in a releasable state. If you are working on a larger change, or if you don't want this change to see the light of the day just yet, consider using a feature branch first, and only merge into the main branch when the code complete and ready to be released.

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Mar 7, 2025

Coverage Report 1

Affected Products

  • firebase-sessions

    Overall coverage changed from 72.39% (4128d9a) to 71.96% (cbc253a) by -0.43%.

    14 individual files with coverage change

    FilenameBase (4128d9a)Merge (cbc253a)Diff
    DaggerFirebaseSessionsComponent.java?0.00%?
    EventGDTLogger.kt75.00%70.00%-5.00%
    EventGDTLogger_Factory.java?0.00%?
    FirebaseSessionsComponent.kt?0.00%?
    FirebaseSessionsComponent_MainModule_Companion_SessionGeneratorFactory.java?0.00%?
    FirebaseSessions_Factory.java?0.00%?
    SessionDatastore.kt2.50%2.70%+0.20%
    SessionDatastoreImpl_Factory.java?0.00%?
    SessionFirelogPublisher.kt83.78%84.21%+0.43%
    SessionFirelogPublisherImpl_Factory.java?0.00%?
    SessionGenerator.kt91.67%92.00%+0.33%
    SessionLifecycleServiceBinderImpl_Factory.java?0.00%?
    SessionsSettings.kt94.64%94.74%+0.09%
    SessionsSettings_Factory.java?0.00%?

Test Logs

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

Copy link
Contributor

github-actions bot commented Mar 7, 2025

Test Results

 38 files   38 suites   56s ⏱️
 95 tests  95 ✅ 0 💤 0 ❌
190 runs  190 ✅ 0 💤 0 ❌

Results for commit 86febc4.

♻️ This comment has been updated with latest results.

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Mar 7, 2025

Size Report 1

Affected Products

  • firebase-sessions

    TypeBase (4128d9a)Merge (cbc253a)Diff
    aar168 kB190 kB+21.8 kB (+13.0%)
    apk (aggressive)375 kB377 kB+1.17 kB (+0.3%)
    apk (release)6.29 MB6.31 MB+13.6 kB (+0.2%)

Test Logs

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

@mrober mrober changed the base branch from main to perf-aqs March 7, 2025 18:15
@mrober mrober changed the base branch from perf-aqs to fireperf-aqs March 7, 2025 21:04
@mrober mrober force-pushed the mrober/aqs-dagger branch from 0c2c9b8 to 86febc4 Compare March 10, 2025 14:32
@mrober mrober changed the base branch from fireperf-aqs to main March 10, 2025 14:32
@mrober mrober merged commit 9340503 into main Mar 11, 2025
66 checks passed
@mrober mrober deleted the mrober/aqs-dagger branch March 11, 2025 13:19
@firebase firebase locked and limited conversation to collaborators Apr 11, 2025
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