Skip to content

Commit 0fef2dd

Browse files
authored
Merge pull request #298 from powersync-ja/chore/user-agent-format
Updated user agent string formats to match backend parser requirements
2 parents 08a3522 + 1e14b3b commit 0fef2dd

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## 1.9.0 (unreleased)
44

5+
- Updated user agent string formats to allow viewing version distributions in the new PowerSync dashboard.
56
- Sync options: `newClientImplementation` is now the default.
67
- Make `androidx.sqlite:sqlite-bundled` an API dependency of `:core` to avoid toolchain warnings.
78

common/src/androidMain/kotlin/com/powersync/sync/UserAgent.android.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ package com.powersync.sync
33
import android.os.Build
44
import com.powersync.build.LIBRARY_VERSION
55

6-
internal actual fun userAgent(): String = "PowerSync Kotlin SDK v$LIBRARY_VERSION (Android ${Build.VERSION.SDK_INT})"
6+
internal actual fun userAgent(): String = "powersync-kotlin/$LIBRARY_VERSION android/${Build.VERSION.SDK_INT}"

common/src/jvmMain/kotlin/com/powersync/sync/UserAgent.jvm.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ internal actual fun userAgent(): String {
77
val osVersion = System.getProperty("os.version") ?: ""
88
val java = System.getProperty("java.vendor.version") ?: System.getProperty("java.runtime.version") ?: "unknown"
99

10-
return "PowerSync Kotlin SDK v${LIBRARY_VERSION} (running Java $java on $os $osVersion)"
10+
return "powersync-kotlin/${LIBRARY_VERSION} Java/$java $os/$osVersion"
1111
}

common/src/nativeMain/kotlin/com/powersync/sync/UserAgent.native.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@ import com.powersync.build.LIBRARY_VERSION
44
import kotlin.experimental.ExperimentalNativeApi
55

66
@OptIn(ExperimentalNativeApi::class)
7-
internal actual fun userAgent(): String =
8-
"PowerSync Kotlin SDK v$LIBRARY_VERSION (running on ${Platform.cpuArchitecture.name} ${Platform.osFamily.name})"
7+
internal actual fun userAgent(): String = "powersync-kotlin/v$LIBRARY_VERSION ${Platform.cpuArchitecture.name}/${Platform.osFamily.name}"

0 commit comments

Comments
 (0)