Skip to content

Commit 5ff1732

Browse files
committed
merge
2 parents 8bdbce1 + bbf8af8 commit 5ff1732

33 files changed

+1696
-1210
lines changed

Cargo.Bazel.lock

Lines changed: 639 additions & 393 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.lock

Lines changed: 180 additions & 138 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -19,31 +19,31 @@ android_logger = { version = "0.15.1", default-features = false }
1919
anyhow = "1.0.100"
2020
assert_matches = "1.5.0"
2121
async-trait = "0.1.89"
22-
bd-api = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "386f9d2e484ffcfc719d4990490fb0bc587650ae" }
23-
bd-bonjson = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "386f9d2e484ffcfc719d4990490fb0bc587650ae" }
24-
bd-bonjson-ffi = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "386f9d2e484ffcfc719d4990490fb0bc587650ae" }
25-
bd-buffer = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "386f9d2e484ffcfc719d4990490fb0bc587650ae" }
26-
bd-client-common = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "386f9d2e484ffcfc719d4990490fb0bc587650ae" }
27-
bd-client-stats-store = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "386f9d2e484ffcfc719d4990490fb0bc587650ae" }
28-
bd-crash-handler = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "386f9d2e484ffcfc719d4990490fb0bc587650ae" }
29-
bd-device = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "386f9d2e484ffcfc719d4990490fb0bc587650ae" }
30-
bd-error-reporter = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "386f9d2e484ffcfc719d4990490fb0bc587650ae" }
31-
bd-grpc = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "386f9d2e484ffcfc719d4990490fb0bc587650ae" }
32-
bd-hyper-network = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "386f9d2e484ffcfc719d4990490fb0bc587650ae" }
33-
bd-key-value = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "386f9d2e484ffcfc719d4990490fb0bc587650ae" }
34-
bd-log = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "386f9d2e484ffcfc719d4990490fb0bc587650ae" }
35-
bd-log-metadata = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "386f9d2e484ffcfc719d4990490fb0bc587650ae" }
36-
bd-log-primitives = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "386f9d2e484ffcfc719d4990490fb0bc587650ae" }
37-
bd-logger = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "386f9d2e484ffcfc719d4990490fb0bc587650ae" }
38-
bd-noop-network = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "386f9d2e484ffcfc719d4990490fb0bc587650ae" }
39-
bd-proto = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "386f9d2e484ffcfc719d4990490fb0bc587650ae" }
40-
bd-report-parsers = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "386f9d2e484ffcfc719d4990490fb0bc587650ae" }
41-
bd-report-writer = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "386f9d2e484ffcfc719d4990490fb0bc587650ae" }
42-
bd-runtime = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "386f9d2e484ffcfc719d4990490fb0bc587650ae" }
43-
bd-session = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "386f9d2e484ffcfc719d4990490fb0bc587650ae" }
44-
bd-shutdown = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "386f9d2e484ffcfc719d4990490fb0bc587650ae" }
45-
bd-test-helpers = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "386f9d2e484ffcfc719d4990490fb0bc587650ae", default-features = false }
46-
bd-time = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "386f9d2e484ffcfc719d4990490fb0bc587650ae" }
22+
bd-api = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "2c6df67adad94c8163322143fdb8344027cea000" }
23+
bd-bonjson = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "2c6df67adad94c8163322143fdb8344027cea000" }
24+
bd-bonjson-ffi = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "2c6df67adad94c8163322143fdb8344027cea000" }
25+
bd-buffer = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "2c6df67adad94c8163322143fdb8344027cea000" }
26+
bd-client-common = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "2c6df67adad94c8163322143fdb8344027cea000" }
27+
bd-client-stats-store = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "2c6df67adad94c8163322143fdb8344027cea000" }
28+
bd-crash-handler = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "2c6df67adad94c8163322143fdb8344027cea000" }
29+
bd-device = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "2c6df67adad94c8163322143fdb8344027cea000" }
30+
bd-error-reporter = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "2c6df67adad94c8163322143fdb8344027cea000" }
31+
bd-grpc = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "2c6df67adad94c8163322143fdb8344027cea000" }
32+
bd-hyper-network = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "2c6df67adad94c8163322143fdb8344027cea000" }
33+
bd-key-value = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "2c6df67adad94c8163322143fdb8344027cea000" }
34+
bd-log = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "2c6df67adad94c8163322143fdb8344027cea000" }
35+
bd-log-metadata = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "2c6df67adad94c8163322143fdb8344027cea000" }
36+
bd-log-primitives = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "2c6df67adad94c8163322143fdb8344027cea000" }
37+
bd-logger = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "2c6df67adad94c8163322143fdb8344027cea000" }
38+
bd-noop-network = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "2c6df67adad94c8163322143fdb8344027cea000" }
39+
bd-proto = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "2c6df67adad94c8163322143fdb8344027cea000" }
40+
bd-report-parsers = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "2c6df67adad94c8163322143fdb8344027cea000" }
41+
bd-report-writer = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "2c6df67adad94c8163322143fdb8344027cea000" }
42+
bd-runtime = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "2c6df67adad94c8163322143fdb8344027cea000" }
43+
bd-session = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "2c6df67adad94c8163322143fdb8344027cea000" }
44+
bd-shutdown = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "2c6df67adad94c8163322143fdb8344027cea000" }
45+
bd-test-helpers = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "2c6df67adad94c8163322143fdb8344027cea000", default-features = false }
46+
bd-time = { git = "https://github.com/bitdriftlabs/shared-core.git", rev = "2c6df67adad94c8163322143fdb8344027cea000" }
4747
clap = { version = "4.5.53", features = ["derive", "env"] }
4848
ctor = "0.6.3"
4949
env_logger = { version = "0.11.8", default-features = false }
@@ -68,11 +68,11 @@ rand = "0.9.2"
6868
rand_distr = "0.5.1"
6969
regex = "1.12.2"
7070
serde = { version = "1", features = ["derive"] }
71-
serde_json = "1.0.145"
72-
tempfile = "3.23.0"
71+
serde_json = "1.0.148"
72+
tempfile = "3.24.0"
7373
time = { version = "0.3.44", features = ["serde-well-known", "macros"] }
7474
tokio = { version = "1.48.0", features = ["full", "test-util"] }
75-
tracing = { version = "0.1.43", features = ["log"] }
75+
tracing = { version = "0.1.44", features = ["log"] }
7676
tracing-subscriber = { version = "0.3.22", features = ["env-filter"] }
7777
uuid = { version = "1.19.0", features = ["v4"] }
7878

platform/jvm/capture/src/main/kotlin/io/bitdrift/capture/CaptureJniLibrary.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,14 @@ internal object CaptureJniLibrary : IBridge, IStreamingReportProcessor {
6565
eventsListenerTarget: IEventsListenerTarget,
6666
applicationId: String,
6767
applicationVersion: String,
68+
applicationVersionCode: Long,
6869
model: String,
70+
osVersion: String,
71+
osApiLevel: String,
72+
osBrand: String,
73+
manufacturer: String,
74+
architecture: String,
75+
supportedAbis: Array<String>,
6976
network: ICaptureNetwork,
7077
preferences: IPreferences,
7178
errorReporter: IErrorReporter,

platform/jvm/capture/src/main/kotlin/io/bitdrift/capture/IBridge.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,14 @@ internal interface IBridge {
2222
eventsListenerTarget: IEventsListenerTarget,
2323
applicationId: String,
2424
applicationVersion: String,
25+
applicationVersionCode: Long,
2526
model: String,
27+
osVersion: String,
28+
osApiLevel: String,
29+
osBrand: String,
30+
manufacturer: String,
31+
architecture: String,
32+
supportedAbis: Array<String>,
2633
network: ICaptureNetwork,
2734
preferences: IPreferences,
2835
errorReporter: IErrorReporter,

platform/jvm/capture/src/main/kotlin/io/bitdrift/capture/LoggerImpl.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,14 @@ internal class LoggerImpl(
200200
eventsListenerTarget,
201201
clientAttributes.appId,
202202
clientAttributes.appVersion,
203+
clientAttributes.appVersionCode,
203204
clientAttributes.model,
205+
clientAttributes.osVersion,
206+
clientAttributes.osApiLevel.toString(),
207+
clientAttributes.osBrand,
208+
clientAttributes.manufacturer,
209+
clientAttributes.architecture,
210+
clientAttributes.supportedAbis.toTypedArray(),
204211
network,
205212
preferences,
206213
localErrorReporter,

platform/jvm/capture/src/main/kotlin/io/bitdrift/capture/attributes/ClientAttributes.kt

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -73,26 +73,7 @@ internal class ClientAttributes(
7373
}
7474

7575
private val cachedAttributes by lazy {
76-
mutableMapOf(
77-
// The package name which identifies the running app (e.g. me.foobar.android).
78-
"app_id" to appId,
79-
// Operating system. Always Android for this code path.
80-
"os" to "Android",
81-
// The operating system version (e.g. 12.1).
82-
"os_version" to osVersion,
83-
// Device model name.
84-
"model" to model,
85-
// The SDK level (e.g. 35).
86-
"_os_api_level" to osApiLevel.toString(),
87-
// The version of this package, as specified by the manifest's `versionName` attribute.
88-
// (e.g. 1.2.33).
89-
"app_version" to appVersion,
90-
// A positive integer used as an internal version number.
91-
// This number helps determine whether one version is more recent than another.
92-
"_app_version_code" to appVersionCode.toString(),
93-
// The current architecture e.g. (arm64-v8a).
94-
"_architecture" to architecture,
95-
)
76+
mutableMapOf<String, String>()
9677
}
9778

9879
override fun invoke(): Fields {

platform/jvm/capture/src/test/kotlin/io/bitdrift/capture/CaptureLoggerNetworkTest.kt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,14 @@ class CaptureLoggerNetworkTest {
8787
mock(),
8888
"test",
8989
"test",
90+
1L,
9091
"test",
92+
"test",
93+
"test",
94+
"test",
95+
"test",
96+
"test",
97+
emptyArray(),
9198
network,
9299
mock(),
93100
mock(),
@@ -170,7 +177,14 @@ class CaptureLoggerNetworkTest {
170177
mock(),
171178
"test",
172179
"test",
180+
1L,
181+
"test",
182+
"test",
183+
"test",
173184
"test",
185+
"test",
186+
"test",
187+
emptyArray(),
174188
network,
175189
mock(),
176190
mock(),
@@ -204,7 +218,14 @@ class CaptureLoggerNetworkTest {
204218
mock(),
205219
"test",
206220
"test",
221+
1L,
222+
"test",
223+
"test",
224+
"test",
225+
"test",
226+
"test",
207227
"test",
228+
emptyArray(),
208229
network,
209230
// this test fails if we pass mock() in here. It has something to do with
210231
// jni trying to call methods on Mockito mocks.

platform/jvm/capture/src/test/kotlin/io/bitdrift/capture/CaptureLoggerTest.kt

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,10 @@ class CaptureLoggerTest {
258258
"device_id" to deviceId,
259259
"platform" to "android",
260260
"model" to "robolectric",
261+
"_app_version_code" to "0",
262+
"_os_api_level" to "24",
263+
"os_version" to "7.0",
264+
"_architecture" to "armeabi-v7a",
261265
),
262266
listOf("sdk_version", "config_version"),
263267
),
@@ -511,7 +515,17 @@ class CaptureLoggerTest {
511515
ContextHolder.APP_CONTEXT,
512516
ProcessLifecycleOwner.get(),
513517
).invoke().toFieldValueMap() +
514-
NetworkAttributes(ContextHolder.APP_CONTEXT).invoke().toFieldValueMap()
518+
NetworkAttributes(ContextHolder.APP_CONTEXT).invoke().toFieldValueMap() +
519+
mapOf(
520+
"_app_version_code" to "0".toFieldValue(),
521+
"_architecture" to "armeabi-v7a".toFieldValue(),
522+
"_locale" to "ar".toFieldValue(),
523+
"_os_api_level" to "24".toFieldValue(),
524+
"app_id" to "io.bitdrift.capture".toFieldValue(),
525+
"app_version" to "?.?.?".toFieldValue(),
526+
"model" to "robolectric".toFieldValue(),
527+
"os_version" to "7.0".toFieldValue(),
528+
)
515529

516530
private fun Map<String, String>.toFieldValueMap(): Map<String, FieldValue> = mapValues { (_, v) -> v.toFieldValue() }
517531
}

platform/jvm/capture/src/test/kotlin/io/bitdrift/capture/ConfigurationTest.kt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@ class ConfigurationTest {
4545
anyOrNull(),
4646
anyOrNull(),
4747
anyOrNull(),
48+
anyOrNull(),
49+
anyOrNull(),
50+
anyOrNull(),
51+
anyOrNull(),
52+
anyOrNull(),
53+
anyOrNull(),
54+
anyOrNull(),
4855
),
4956
).thenReturn(-1L)
5057

@@ -77,6 +84,13 @@ class ConfigurationTest {
7784
anyOrNull(),
7885
anyOrNull(),
7986
anyOrNull(),
87+
anyOrNull(),
88+
anyOrNull(),
89+
anyOrNull(),
90+
anyOrNull(),
91+
anyOrNull(),
92+
anyOrNull(),
93+
anyOrNull(),
8094
)
8195

8296
// We perform another attempt to configure the logger to verify that
@@ -106,6 +120,13 @@ class ConfigurationTest {
106120
anyOrNull(),
107121
anyOrNull(),
108122
anyOrNull(),
123+
anyOrNull(),
124+
anyOrNull(),
125+
anyOrNull(),
126+
anyOrNull(),
127+
anyOrNull(),
128+
anyOrNull(),
129+
anyOrNull(),
109130
)
110131
}
111132

0 commit comments

Comments
 (0)