Skip to content

fix: firebase upload failure in KMP demo app workflow#3112

Open
amanna13 wants to merge 1 commit intoopenMF:developmentfrom
amanna13:fix/firebase-upload-failure
Open

fix: firebase upload failure in KMP demo app workflow#3112
amanna13 wants to merge 1 commit intoopenMF:developmentfrom
amanna13:fix/firebase-upload-failure

Conversation

@amanna13
Copy link
Contributor

@amanna13 amanna13 commented Feb 13, 2026

Fixes - Jira-#534

Screenshots

by running ./gradlew assembleDemoRelease
Screenshot 2026-02-13 215811

Please make sure these boxes are checked before submitting your pull request - thanks!

  • Run the static analysis check ./gradlew check or ci-prepush.sh to make sure you didn't break anything

  • If you have multiple commits please combine them into one commit by squashing them.

Summary by CodeRabbit

Release Notes

  • New Features

    • Expanded Room database annotations support (Update, Delete, Upsert, Transaction, and more) for enhanced database operations.
    • Added comprehensive cross-platform database functionality for Android, Desktop, and Native platforms.
  • Documentation

    • Significantly improved database module documentation with detailed usage examples, best practices, and platform-specific guidance.
  • Refactor

    • Reorganized database factory implementations for improved cross-platform compatibility.
    • Consolidated database module dependencies into a unified base structure.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 13, 2026

📝 Walkthrough

Walkthrough

The pull request refactors database abstractions from platform-specific implementations into a shared core-base module using Kotlin's expect/actual pattern. Room annotations are consolidated into expect declarations with nonJsCommon typealiases, platform factories are consolidated, and all database-dependent modules update imports to reference the centralized abstraction layer.

Changes

Cohort / File(s) Summary
Compiler & Library Configuration
build-logic/convention/src/main/kotlin/org/mifos/mobile/KotlinAndroid.kt, core-base/analytics/src/commonMain/kotlin/template/core/base/analytics/AnalyticsExtensions.kt, core-base/analytics/src/commonMain/kotlin/template/core/base/analytics/PerformanceTracker.kt
Added Kotlin opt-in compiler flags for ExperimentalCoroutinesApi, RequiresOptIn, and ExperimentalTime. Updated time library imports from kotlinx.datetime.Clock to kotlin.time.Clock.
Core-Base Database Abstraction Layer
core-base/database/README.md, core-base/database/src/commonMain/kotlin/template/core/base/database/Room.kt, core-base/database/src/nonJsCommonMain/kotlin/template/core/base/database/Room.nonJsCommon.kt
Expanded documentation with architectural details, usage examples, and best practices. Added comprehensive expect annotations for Room entities (Update, Delete, Upsert, Transaction, ColumnInfo, Embedded, Relation, Junction, TypeConverters, Database, AutoMigration, Ignore, DatabaseView). Introduced OnConflictStrategy, ColumnInfoTypeAffinity, and CollationSequence constants. Implemented actual typealiases mapping to androidx.room for non-JS platforms.
Core-Base Database Factory & TypeConverter Migration
core-base/database/src/androidMain/kotlin/template/core/base/database/AppDatabaseFactory.kt, core-base/database/src/commonMain/kotlin/template/core/base/database/TypeConverter.kt, core-base/database/src/nonJsCommonMain/kotlin/template/core/base/database/TypeConverter.nonJsCommon.kt
Reformatted AppDatabaseFactory parameter list to multi-line format. Consolidated TypeConverter into Room.kt and removed standalone TypeConverter files.
Core Database Dependency & Import Updates
core/database/build.gradle.kts, core/database/src/commonMain/kotlin/org/mifos/mobile/core/database/dao/ChargeDao.kt, core/database/src/commonMain/kotlin/org/mifos/mobile/core/database/dao/MifosNotificationDao.kt, core/database/src/commonMain/kotlin/org/mifos/mobile/core/database/entity/ChargeEntity.kt, core/database/src/commonMain/kotlin/org/mifos/mobile/core/database/entity/MifosNotificationEntity.kt, core/database/src/commonMain/kotlin/org/mifos/mobile/core/database/utils/ChargeTypeConverters.kt
Added coreBase.database as public API dependency. Updated all DAO, entity, and type converter imports from org.mifos.mobile.core.database to template.core.base.database.
Core Database Platform Factory Refactoring
core/database/src/androidMain/kotlin/org/mifos/mobile/core/database/AppDatabaseFactory.kt, core/database/src/desktopMain/kotlin/org/mifos/mobile/core/database/AppDatabaseFactory.kt, core/database/src/nativeMain/kotlin/org/mifos/mobile/core/database/AppDatabaseFactory.kt
Removed platform-specific factory implementations (Android, Desktop, Native) that previously handled OS-specific database initialization logic.
Core Database DI Module Updates
core/database/src/androidMain/kotlin/org/mifos/mobile/core/database/di/DatabaseModule.android.kt, core/database/src/desktopMain/kotlin/org/mifos/mobile/core/database/di/DatabaseModule.desktop.kt, core/database/src/nativeMain/kotlin/org/mifos/mobile/core/database/di/DatabaseModule.native.kt
Updated factory imports to use template.core.base.database.AppDatabaseFactory. Changed database creation from createDatabase() to generic createDatabase<AppDatabase>(AppDatabase.DATABASE_NAME) signature with explicit .build() call.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 A hop, a skip, abstractions take flight,
Room annotations bundled just right,
Platform-specific paths fade away,
Shared expect/actual guide the day,
Multi-platform databases—hooray! 🎉

🚥 Pre-merge checks | ✅ 3 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Title check ⚠️ Warning The PR title 'fix: firebase upload failure in KMP demo app workflow' does not accurately reflect the changeset. The changes primarily involve refactoring Room database imports and abstractions across multiple modules (moving from org.mifos.mobile.core.database to template.core.base.database), expanding Kotlin compiler options, and updating documentation. There is no evidence of Firebase upload fixes or KMP demo app workflow changes in the actual code modifications. Update the title to accurately reflect the main changes, such as 'refactor: migrate Room database imports to core-base module' or 'refactor: abstract Room database layer for Kotlin Multiplatform support'
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into development

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 6

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
core-base/analytics/src/commonMain/kotlin/template/core/base/analytics/PerformanceTracker.kt (1)

28-50: ⚠️ Potential issue | 🟠 Major

Fix currentTime being constant (breaks all timing).

private val currentTime = Clock.System.now().toEpochMilliseconds() is initialized once, so all timers, durations, and lifecycle timestamps use the same value. This yields 0/negative durations and duplicate timer IDs. Replace with a function/property that reads the clock each time.

🔧 Proposed fix
-private val currentTime = Clock.System.now().toEpochMilliseconds()
+private fun currentTimeMillis(): Long = Clock.System.now().toEpochMilliseconds()
-        val timerId = "${operationName}_$currentTime"
-        activeTimers[timerId] = currentTime
+        val now = currentTimeMillis()
+        val timerId = "${operationName}_$now"
+        activeTimers[timerId] = now
-        val duration = currentTime - startTime
+        val duration = currentTimeMillis() - startTime
-        appStartTime = currentTime
+        appStartTime = currentTimeMillis()
-        val launchDuration = currentTime - startTime
+        val launchDuration = currentTimeMillis() - startTime
-        backgroundTime = currentTime
+        backgroundTime = currentTimeMillis()
-        val currentTime = currentTime
+        val currentTime = currentTimeMillis()

Also applies to: 188-240, 265-265

core/database/build.gradle.kts (1)

1-19: ⚠️ Potential issue | 🟡 Minor

Duplicate copyright headers.

The file contains two consecutive copyright blocks (2026 on Lines 1–9, 2024 on Lines 11–19). Remove one of them.

Proposed fix
 /*
  * Copyright 2026 Mifos Initiative
  *
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at https://mozilla.org/MPL/2.0/.
  *
  * See https://github.com/openMF/mobile-mobile/blob/master/LICENSE.md
  */
-
-/*
- * Copyright 2024 Mifos Initiative
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at https://mozilla.org/MPL/2.0/.
- *
- * See https://github.com/openMF/mobile-mobile/blob/master/LICENSE.md
- */
 plugins {
🤖 Fix all issues with AI agents
In `@build-logic/convention/src/main/kotlin/org/mifos/mobile/KotlinAndroid.kt`:
- Around line 71-73: Remove the incorrect opt-in flag added via
freeCompilerArgs.add("-opt-in=kotlin.RequiresOptIn") in KotlinAndroid.kt (the
meta-annotation has no effect as an opt-in) and delete that line; also review
the freeCompilerArgs.add("-opt-in=kotlin.time.ExperimentalTime") entry and
remove it if your codebase no longer uses legacy `@ExperimentalTime` annotations
or if Kotlin 2.1.20/1.9+ makes those APIs stable—search for freeCompilerArgs.add
invocations in the KotlinAndroid.kt setup and update those specific lines
accordingly.

In `@cmp-shared/cmp_shared.podspec`:
- Line 53: The podspec currently uses a Windows-style path in the spec.resources
string ('build\compose\cocoapods\compose-resources'); change that to a
POSIX-style path with forward slashes (e.g.,
'build/compose/cocoapods/compose-resources') so CocoaPods on macOS can correctly
discover resources; update the spec.resources assignment in cmp_shared.podspec
(the spec.resources = ... line) to use the forward-slash path.

In `@core-base/database/README.md`:
- Around line 613-615: The README's license reference incorrectly points to the
template repo URL
"https://github.com/openMF/kmp-project-template/blob/main/LICENSE"; update that
link in core-base/database/README.md to point to this project's LICENSE (replace
the kmp-project-template URL with the correct mifos-mobile repository license
URL, e.g. "https://github.com/openMF/mifos-mobile/blob/main/LICENSE") so the
license link reflects this repository.
- Line 534: The README incorrectly references Room version and API level: update
any mention of "androidx.room.runtime (2.8.4+)" to the actual configured version
"2.7.2" (and note that 2.8.x would require API 23 if you want to call that out),
and change the minimum API statement "API 16+" to the correct minimum for 2.7.2
which is "API 21"; search the README for other Room version/API mentions and
align them with gradle/libs.versions.toml (or annotate that newer 2.8.x requires
API 23) so documentation and actual dependency config match.

In
`@core-base/database/src/commonMain/kotlin/template/core/base/database/Room.kt`:
- Around line 670-676: The expect annotation class Ignore currently lists only
AnnotationTarget.FIELD and AnnotationTarget.CONSTRUCTOR which prevents using
`@Ignore` on getters and functions; update the target list for the expect
annotation class Ignore to also include AnnotationTarget.FUNCTION and
AnnotationTarget.PROPERTY_GETTER so it matches androidx.room.Ignore (i.e.,
modify the AnnotationTarget(...) block in the expect annotation class Ignore
declaration).

In
`@core/database/src/commonMain/kotlin/org/mifos/mobile/core/database/dao/ChargeDao.kt`:
- Around line 13-17: The import of OnConflictStrategy in ChargeDao.kt should be
changed to use the centralized definition in the base module to match the other
Room abstractions; update the import for OnConflictStrategy to come from
template.core.base.database (same module as Dao, Insert, Query) so that
ChargeDao references template.core.base.database.OnConflictStrategy instead of
org.mifos.mobile.core.database.OnConflictStrategy.
🧹 Nitpick comments (1)
core-base/database/src/commonMain/kotlin/template/core/base/database/Room.kt (1)

10-10: File-level suppression is redundant with per-declaration suppressions.

Every expect declaration in this file already carries its own @Suppress("NO_ACTUAL_FOR_EXPECT"). The file-level @file:Suppress("KotlinNoActualForExpect") suppresses a slightly different warning key (KotlinNoActualForExpect vs NO_ACTUAL_FOR_EXPECT). If the intent is to cover both warning variants, this is fine, but worth a brief inline comment explaining why both suppression keys are needed.

@amanna13 amanna13 marked this pull request as draft February 13, 2026 17:06
@amanna13 amanna13 force-pushed the fix/firebase-upload-failure branch from 576c501 to 4abf61a Compare February 13, 2026 17:13
@amanna13 amanna13 marked this pull request as ready for review February 13, 2026 17:14
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
core/database/build.gradle.kts (1)

1-19: ⚠️ Potential issue | 🟡 Minor

Duplicate copyright header block.

The file contains two consecutive copyright headers (lines 1–9 and 11–19). Remove one.

Proposed fix
-/*
- * Copyright 2026 Mifos Initiative
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at https://mozilla.org/MPL/2.0/.
- *
- * See https://github.com/openMF/mobile-mobile/blob/master/LICENSE.md
- */
-
 /*
- * Copyright 2024 Mifos Initiative
+ * Copyright 2026 Mifos Initiative
  *
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
🧹 Nitpick comments (1)
core-base/database/src/commonMain/kotlin/template/core/base/database/Room.kt (1)

567-570: BuiltInTypeConverters expect has no parameters — intentional limitation in common code.

The actual androidx.room.BuiltInTypeConverters has enums and uuid parameters. The zero-arg expect means common code can only use defaults. If fine-grained control is needed in shared code later, parameters will need to be added here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant