Skip to content

Commit e556b04

Browse files
ovitrifclaude
andcommitted
chore: update vss-rust-client-ffi
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent b1693c0 commit e556b04

File tree

2 files changed

+26
-11
lines changed

2 files changed

+26
-11
lines changed

app/src/main/java/to/bitkit/data/backup/VssBackupClientLdk.kt

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package to.bitkit.data.backup
22

33
import com.synonym.vssclient.KeyVersion
4+
import com.synonym.vssclient.LdkNamespace
45
import com.synonym.vssclient.VssItem
56
import com.synonym.vssclient.vssDeleteLdk
67
import com.synonym.vssclient.vssGetLdk
@@ -28,11 +29,14 @@ class VssBackupClientLdk @AssistedInject constructor(
2829
fun create(awaitSetup: suspend () -> Unit): VssBackupClientLdk
2930
}
3031

31-
suspend fun getObject(key: String): Result<VssItem?> = withContext(ioDispatcher) {
32+
suspend fun getObject(
33+
key: String,
34+
namespace: LdkNamespace = LdkNamespace.Default,
35+
): Result<VssItem?> = withContext(ioDispatcher) {
3236
awaitSetup()
3337
Logger.verbose("VSS LDK 'getObject' call for '$key'", context = TAG)
3438
runCatching {
35-
vssGetLdk(key = key)
39+
vssGetLdk(key = key, namespace = namespace)
3640
}.onSuccess {
3741
if (it == null) {
3842
Logger.verbose("VSS LDK 'getObject' success null for '$key'", context = TAG)
@@ -44,23 +48,30 @@ class VssBackupClientLdk @AssistedInject constructor(
4448
}
4549
}
4650

47-
suspend fun putObject(key: String, data: ByteArray): Result<VssItem> = withContext(ioDispatcher) {
51+
suspend fun putObject(
52+
key: String,
53+
data: ByteArray,
54+
namespace: LdkNamespace = LdkNamespace.Default,
55+
): Result<VssItem> = withContext(ioDispatcher) {
4856
awaitSetup()
4957
Logger.verbose("VSS LDK 'putObject' call for '$key'", context = TAG)
5058
runCatching {
51-
vssStoreLdk(key = key, value = data)
59+
vssStoreLdk(key = key, value = data, namespace = namespace)
5260
}.onSuccess {
5361
Logger.verbose("VSS LDK 'putObject' success for '$key' at version: '${it.version}'", context = TAG)
5462
}.onFailure {
5563
Logger.verbose("VSS LDK 'putObject' error for '$key'", it, context = TAG)
5664
}
5765
}
5866

59-
suspend fun deleteObject(key: String): Result<Boolean> = withContext(ioDispatcher) {
67+
suspend fun deleteObject(
68+
key: String,
69+
namespace: LdkNamespace = LdkNamespace.Default,
70+
): Result<Boolean> = withContext(ioDispatcher) {
6071
awaitSetup()
6172
Logger.verbose("VSS LDK 'deleteObject' call for '$key'", context = TAG)
6273
runCatching {
63-
vssDeleteLdk(key = key)
74+
vssDeleteLdk(key = key, namespace = namespace)
6475
}.onSuccess { wasDeleted ->
6576
if (wasDeleted) {
6677
Logger.verbose("VSS LDK 'deleteObject' success for '$key' - key was deleted", context = TAG)
@@ -72,23 +83,27 @@ class VssBackupClientLdk @AssistedInject constructor(
7283
}
7384
}
7485

75-
suspend fun listKeys(): Result<List<KeyVersion>> = withContext(ioDispatcher) {
86+
suspend fun listKeys(
87+
namespace: LdkNamespace = LdkNamespace.Default,
88+
): Result<List<KeyVersion>> = withContext(ioDispatcher) {
7689
awaitSetup()
7790
Logger.verbose("VSS LDK 'listKeys' call", context = TAG)
7891
runCatching {
79-
vssListKeysLdk()
92+
vssListKeysLdk(namespace = namespace)
8093
}.onSuccess {
8194
Logger.verbose("VSS LDK 'listKeys' success - found ${it.size} key(s)", context = TAG)
8295
}.onFailure {
8396
Logger.verbose("VSS LDK 'listKeys' error", it, context = TAG)
8497
}
8598
}
8699

87-
suspend fun listItems(): Result<List<VssItem>> = withContext(ioDispatcher) {
100+
suspend fun listItems(
101+
namespace: LdkNamespace = LdkNamespace.Default,
102+
): Result<List<VssItem>> = withContext(ioDispatcher) {
88103
awaitSetup()
89104
Logger.verbose("VSS LDK 'listItems' call", context = TAG)
90105
runCatching {
91-
vssListLdk()
106+
vssListLdk(namespace = namespace)
92107
}.onSuccess {
93108
Logger.verbose("VSS LDK 'listItems' success - found ${it.size} item(s)", context = TAG)
94109
}.onFailure {

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ test-junit-ext = { module = "androidx.test.ext:junit", version = "1.3.0" }
8282
test-mockito-kotlin = { module = "org.mockito.kotlin:mockito-kotlin", version = "6.2.2" }
8383
test-robolectric = { module = "org.robolectric:robolectric", version = "4.16.1" }
8484
test-turbine = { group = "app.cash.turbine", name = "turbine", version = "1.2.1" }
85-
vss-client = { module = "com.synonym:vss-client-android", version = "0.5.2" }
85+
vss-client = { module = "com.synonym:vss-client-android", version = "0.5.5" }
8686
work-runtime-ktx = { module = "androidx.work:work-runtime-ktx", version = "2.11.0" }
8787
zxing = { module = "com.google.zxing:core", version = "3.5.4" }
8888
lottie = { module = "com.airbnb.android:lottie-compose", version = "6.7.1" }

0 commit comments

Comments
 (0)