Colton Idle
08/11/2025, 2:51 PMColton Idle
08/11/2025, 3:12 PMfun sendSync(req: Req): Res
return runBlocking {
sendAsync()
}
suspend fun sendAsync() {...}ursus
08/11/2025, 3:25 PM> Task :foo:app:minifyTstStableReleaseWithR8 FAILED
ERROR: Missing classes detected while running R8. Please add the missing classes or apply additional keep rules that are generated in /Users/bar/AndroidStudioProjects/foo/app/build/outputs/mapping/tstStableRelease/missing_rules.txt.
ERROR: R8: Missing class okhttp3.internal.Util (referenced from: void okhttp3.internal.sse.RealEventSource.processResponse(okhttp3.Response) and 1 other context)
Anyone else experiencing this?Deep Patel
08/16/2025, 4:19 AMColton Idle
08/21/2025, 1:44 PMAn HTTP request. Instances of this class are immutable if their body is null or itself immutable.Like if this was written in kotlin would it just be a data class?
ursus
08/22/2025, 1:04 PMturbine gurus could chime in
private val _state = MutableStateFlow<ChatState>(ChatState.Idle)
override val state: Flow<ChatState> get() = _state
scope.launch {
combine(
conversationDao.conversation.doOnNext { println("-- CONVERSATION=$it") },
connector.connectionState.doOnNext { println("-- CONN_STATE=$it") },
::stateMapper
)
.collect {
println("--- PRODUCED=$it")
_state.value = it
}
}
I have combine which produces as a result and pipes it into stateflow _state. That state flow is then asserted at test time with turbine (ommited)
Issue is that for some reason this is not deterministic. Default value of connectionState is Disconnected and then obviously Connecting etc
What I'm seeing is that sometimes I see Connecting getting emitted before the product of combining with Disconnected gets set to the _state
Othertimes it's not and I see 2 `--- PRODUCED`as expected.
Is this a StateFlow issue? A combine issue? A Turbine issue? A TestDispatcher issue?
Should I maybe not assert all the intermediary emits and just the last one using?Alexander Ioffe
08/29/2025, 8:55 PMsqliter.Cursor from SqliterSqlCursor, ResultSet from JdbcCursor, etc... or
2. Expose some kind of CursorMetadata API?
I'm trying to see if I can integrate my libraries Terpal/ExoQuery with SQLDelight and the missing piece seems to be DB result-set metadata.andylamax
08/31/2025, 9:32 AMfun dependency(dependencyProject: Project)
fun dependency(delegatedProject: DelegatingProjectDependency)
The issue that I have here is that, the dependencies are defined inside a composite build (not just a subproject). And I am having a hard time getting an instance of that subproject. If anyone can help me how to achieve this, I will greatly appreciateShubham Singh
08/31/2025, 2:14 PMandylamax
09/02/2025, 1:57 PMCREATE TABLE IF NOT EXISTS ow_core_people(
uid INTEGER PRIMARY KEY NOT NULL AUTO_INCREMENT,
name TEXT NOT NULL,
photo TEXT
);
Because AUTO_INCREMENT doesn't work on SQLite, it just works on MySQL but fails on SQLite.
Is there a way for SQLDelight to support these multiple syntax and transform them in accordance to the dialect selected?Colton Idle
09/07/2025, 4:58 AMursus
09/09/2025, 11:30 AMsqldelight kotlin migrations, I need to have atleast a placeholder .sqm file.
This is error prone, as nothing seems to enforce the .sqm file.
Has anyone figured out a way to blow up such state? (.kt migration present but .sqm not)Slackbot
09/10/2025, 10:32 AMeygraber
09/12/2025, 6:58 PMColton Idle
09/25/2025, 3:39 PMursus
09/30/2025, 1:11 PManvil user.
Now I want to experiment with KMP.
I want to keep @Inject and @ContributesBinding.. in common - and expect-actual them to typealiases of the jvm libs (and therefore have anvil/dagger take effect only on jvm)
@Inject is easy enough
@Target(
FUNCTION,
PROPERTY_GETTER,
PROPERTY_SETTER,
CONSTRUCTOR,
FIELD
)
@Retention(RUNTIME)
@MustBeDocumented
expect annotation class Inject()
actual typealias Inject = javax.inject.Inject
but I'm having trouble with @ContributesBinding because of all the params. See the full issue in threadColton Idle
09/30/2025, 6:05 PMcom.squareup.okhttp3:mockwebserver3:5.1.0
or
com.squareup.okhttp3:mockwebserver:5.1.0
Are my depenedencies setup incorrectly or should i indeed be seeing both options (if so... which to pick)?ursus
10/01/2025, 9:45 PMByteArray instead of a `String`so I can deterministically clear the value from memory, because GC blah blah.
But, when using okhttp interceptor to attach a token as
val tokenString = String(tokenBytes, Charsets.UTF_8) <-----
val newRequest = request.newBuilder()
.header("Authorization", "Bearer $tokenString")
.build()
then it's a moot point right?
Or -- the question -- is there a smarter what of doing this in okhttp?
Or do I just need to accept the transient token in memory (and therefore holding it as ByteArray is mostly pointless)?Colton Idle
10/08/2025, 8:44 PM./gradlew androidlibrary:assemble is successful, but ./gradlew app:assemble fails due to
* What went wrong:
Execution failed for task ':app:checkDebugDuplicateClasses'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
> Duplicate class okhttp3.Address found in modules okhttp-jvm-5.1.0.jar -> okhttp-jvm-5.1.0 (com.squareup.okhttp3:okhttp-jvm:5.1.0) and okhttp-release.aar -> okhttp-release-runtime (com.squareup.okhttp3:okhttp-android:5.1.0)
seems like something regarding okhttp-jvm and okhttp-android? according to docs, this shouldn't be an issue since im using gradle and not maven?jessewilson
10/09/2025, 9:57 PMColton Idle
10/09/2025, 10:16 PMeygraber
10/12/2025, 4:42 PMQueryResult.AsyncValue, not because the driver itself is async, but because I want to use coroutines in my connection pool. Is that "abusing" the system, or a valid use case?eygraber
10/13/2025, 10:02 PMtransaction though, because it doesn't like the transaction escaping the thread it is started on, which is what happens with the dispatcher support (newTransaction, execute, and executeQuery use withContext to switch into the proper dispatcher).
Is there any way to hook into the transacter to support this, and if not, is there any chance support for this could get added to SqlDelight?Yassine Abou
10/15/2025, 8:25 PMno such table: user error with SQLDelight on a Kotlin Multiplatform project.
I've tried the common solutions like manually calling Schema.create(driver), deleting the old database file, and ensuring I'm using a singleton instance for the database, but the problem persists. It seems the schema creation is either not happening or is happening after my first query is executed.
Full stacktrace and code in thread 👇🏽Colton Idle
10/17/2025, 5:50 PMYassine Abou
10/17/2025, 10:19 PMtext
org.sqlite.SQLiteException: [SQLITE_ERROR] SQL error or missing database (no such table: chats)
org.sqlite.SQLiteException: [SQLITE_ERROR] SQL error or missing database (no such table: generated_images)
To reproduce the error:
1. Clone the repository: https://github.com/yassineAbou/LLMS.git
2. Run the composeApp desktop target
3. The errors appear immediately during the buildeygraber
10/20/2025, 3:53 AMCoroutineDispatcher you are using.
If you have any thoughts, questions, or concerns, please discuss hereColton Idle
10/24/2025, 2:57 PMcrowforkotlin
10/25/2025, 1:34 AMmaximilianosorich
11/01/2025, 11:03 PMkotlin {
@OptIn(ExperimentalWasmDsl::class)
wasmJs("store") {
browser {
commonWebpackConfig {
outputFileName = "store.js"
}
}
binaries.executable()
}
storeMain.dependencies {
// DB Web worker
implementation(libs.web.worker.driver)
implementation(devNpm("copy-webpack-plugin", "9.1.0"))
implementation(npm("@cashapp/sqldelight-sqljs-worker", "2.1.0"))
implementation(npm("sql.js", "1.8.0"))
}
}
sqldelight {
databases {
create("Database") {
packageName.set("ar.com.cancerbero")
deriveSchemaFromMigrations.set(true)
verifyMigrations.set(true)
generateAsync.set(true)
}
}
}
the webpack.config.d/sqljs.js seems to be working...
config.resolve = {
fallback: {
fs: false,
path: false,
crypto: false,
}
};
const CopyWebpackPlugin = require('copy-webpack-plugin');
config.plugins.push(
new CopyWebpackPlugin({
patterns: [
'../../node_modules/sql.js/dist/sql-wasm.wasm'
]
})
);
the provideDbDriver:
private val workerScriptUrl: String = js("""new URL("@cashapp/sqldelight-sqljs-worker/sqljs.worker.js", import.meta.url)""")
actual suspend fun provideDbDriver(
schema: SqlSchema<QueryResult.AsyncValue<Unit>>
): SqlDriver {
return WebWorkerDriver(
Worker(workerScriptUrl)
).also { schema.create(it).await() }
}
The initialization logic:
object StoreApp {
val scope = CoroutineScope(Dispatchers.Default)
private var database: Database? = null
init {
scope.launch {
val driver = provideDbDriver(Database.Schema)
database = createDatabase(driver)
}
}
}
This error appears at first moment, with no use... So LATER when i try to do something like:
it crashes:
db!!.key_valuesQueries.selectValue("selectedStoreId").asFlow().mapToOneOrNull(Dispatchers.Default),
because of null pointer exception...
The Database,kt in commonMain:
expect suspend fun provideDbDriver(
schema: SqlSchema<QueryResult.AsyncValue<Unit>>
): SqlDriver
fun createDatabase(driver: SqlDriver): Database {
return Database(driver)
// Do more work with the database (see below).
}