Files
Incido/app/build.gradle.kts
T
Incido Developer 5b82d2a9fe fix: v0.3.0.3 — batched hashtag snapshot so Recent Tags fills promptly
The user reported the drawer's Recent Tags list eventually rendered,
but only after a couple of minutes. Root cause was inside
NoteRepositoryImpl:

  1. hashtagUsageSnapshot() called noteBox.get(x.noteId) once per
     cross-ref row. Most notes have multiple hashtags, so each note
     was fetched many times — O(M) Box.get calls where M is the xref
     count.

  2. observeHashtagsByRecentUse() called trySend(snapshot()) BEFORE
     setting up the ObjectBox subscription, then also inside the
     observer. The first emission doubled the work; if the first
     trySend ran before the upstream was warm, the data path itself
     was slow.

Two surgical fixes inside NoteRepositoryImpl.kt:

  - hashtagUsageSnapshot(): batch-load notes by id (one Box.get per
    distinct noteId, not per xref) and tags by id (one Box.get per
    distinct tagId). Net reads drop from (M + N) to
    (distinct noteIds + distinct tagIds) — typically a 5–20×
    reduction.

  - observeHashtagsByRecentUse(): rely solely on the ObjectBox
    observer's first fire (ObjectBox delivers the current query
    state immediately on subscribe). Drop the manual pre-subscribe
    trySend.

VERSION
  - app/build.gradle.kts: versionCode 7 → 8, versionName '0.3.0.2' →
    '0.3.0.3'.
  - README.md changelog: new 0.3.0.3 row.
  - Incido Development Plan.txt §10: new 0.3.0.3 row.

VERIFIED
  - ./gradlew assembleDebug assembleRelease both green.
  - versionCode=8, versionName='0.3.0.3'.
  - No INTERNET permission.
  - Release signed (v2 scheme verified).
2026-08-15 03:18:29 +12:00

107 lines
3.0 KiB
Kotlin

// :app — Android application entry point. Hosts MainActivity and the
// application manifest, including the launcher icon and theme.
//
// Version scheme (v0.3.0.0 onwards):
// versionName = "MAJOR.MINOR.MAINTENANCE.EMERGENCY"
// - MAJOR: large breaking redesigns (rare in v0.x)
// - MINOR: normal feature releases
// - MAINTENANCE: bug fixes / refactors on a given MINOR
// - EMERGENCY: 0 in normal releases; non-zero only for hotfixes
// shipped out-of-band (e.g. v0.2.0.1 — search-icon fix)
// versionCode: monotonic int. Always +1 per release.
//
// The validator below fails the build if versionName doesn't match the
// required dotted format, so we can't regress the scheme by accident.
import java.util.Properties
plugins {
alias(libs.plugins.androidApplication)
alias(libs.plugins.kotlinAndroid)
alias(libs.plugins.kotlinCompose)
}
android {
namespace = "org.incido.app"
compileSdk = 35
defaultConfig {
applicationId = "org.incido.app"
minSdk = 26
targetSdk = 35
versionCode = 8
versionName = "0.3.0.3"
}
// --- Signing ---
signingConfigs {
create("release") {
val keystoreFilePath = rootProject.file("keystore/release.jks")
if (keystoreFilePath.exists()) {
storeFile = keystoreFilePath
storePassword = "incido_dev_keystore"
keyAlias = "incido"
keyPassword = "incido_dev_keystore"
}
}
}
buildTypes {
debug {
isMinifyEnabled = false
}
release {
isMinifyEnabled = false // TODO(v0.3.0.0+): enable R8
signingConfig = signingConfigs.getByName("release")
}
}
buildFeatures {
compose = true
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlin {
jvmToolchain(17)
}
packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
}
}
dependencies {
implementation(project(":composeApp"))
implementation(libs.androidx.core.ktx)
implementation(libs.kotlinx.coroutines.android)
val composeBom = platform(libs.composeBom)
implementation(composeBom)
implementation(libs.androidx.activity.compose)
implementation(libs.compose.ui)
implementation(libs.compose.material3)
}
// --- Version-name scheme validator ---
//
// MAJOR.MINOR.MAINTENANCE.EMERGENCY — exactly four dotted integers.
// Fails fast so we can't accidentally publish a "0.3" again.
val versionScheme = Regex("""^\d+\.\d+\.\d+\.\d+$""")
gradle.taskGraph.whenReady {
val vn = android.defaultConfig.versionName
if (vn != null && !versionScheme.matches(vn)) {
throw GradleException(
"app versionName = \"$vn\" doesn't match the required " +
"MAJOR.MINOR.MAINTENANCE.EMERGENCY scheme (e.g. 0.3.0.0). " +
"Update app/build.gradle.kts."
)
}
}