Skip to content

Commit cb6007b

Browse files
committed
Merge tag 'v0.78.2' into ci
v0.78.2 - Finalize errors produced by SVR-B operations.
2 parents 2b495b6 + 36916db commit cb6007b

File tree

82 files changed

+2149
-1592
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+2149
-1592
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ default-members = [
3737
resolver = "2" # so that our dev-dependency features don't leak into products
3838

3939
[workspace.package]
40-
version = "0.78.0"
40+
version = "0.78.2"
4141
authors = ["Signal Messenger LLC"]
4242
license = "AGPL-3.0-only"
4343
rust-version = "1.83.0"

LibSignalClient.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
Pod::Spec.new do |s|
77
s.name = 'LibSignalClient'
8-
s.version = '0.78.0'
8+
s.version = '0.78.2'
99
s.summary = 'A Swift wrapper library for communicating with the Signal messaging service.'
1010

1111
s.homepage = 'https://github.com/signalapp/libsignal'

RELEASE_NOTES.md

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
1-
v0.78.0
1+
v0.78.2
22

3-
## SVR-B
4-
5-
- Operations have been consistently renamed to `store` and `restore`.
6-
- `restore` now returns an object containing both the BackupForwardSecrecyToken for decryption, and "secret data" to be used in the first `store` after restoration.
7-
- `SvrB` now has a `createNewBackupChain` method, allowing you to locally persist the backup "secret data" *before* the first store to SVR-B for a fresh install.
8-
- With the first two changes, the secret data argument to `restore` is now required. See doc comments for more details.
9-
10-
## Other changes
11-
12-
- Rust: `SessionRecord::has_usable_sender_chain` now takes an additional parameter to specify which criteria make a session "usable" beyond simply *having* a sender chain. The previous behavior can be requested by using `SessionUsabilityRequirements::NotStale`.
3+
- Finalize errors produced by SVR-B operations.

java/android/src/androidTest/java/org/signal/libsignal/util/AndroidBase64.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ public class AndroidBase64 : org.signal.libsignal.util.Base64.Impl {
99

1010
public override fun encode(raw: ByteArray): String = Base64.encodeToString(raw, Base64.NO_WRAP)
1111

12-
public override fun encodeUrl(raw: ByteArray): String = Base64.encodeToString(
13-
raw,
14-
Base64.NO_WRAP or Base64.NO_PADDING or Base64.URL_SAFE,
15-
)
12+
public override fun encodeUrl(raw: ByteArray): String =
13+
Base64.encodeToString(
14+
raw,
15+
Base64.NO_WRAP or Base64.NO_PADDING or Base64.URL_SAFE,
16+
)
1617
}

java/build.gradle

Lines changed: 37 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
44
plugins {
55
id "base"
66
id "signing"
7-
id "com.diffplug.spotless" version "6.20.0"
7+
id "com.diffplug.spotless" version "7.2.1"
88
id "io.github.gradle-nexus.publish-plugin" version "2.0.0"
99

1010
id "org.jetbrains.kotlin.jvm" version "2.1.0" apply false
@@ -15,8 +15,14 @@ plugins {
1515
id 'org.jetbrains.kotlin.android' version "2.1.0" apply false
1616
}
1717

18+
repositories {
19+
mavenCentral()
20+
google()
21+
mavenLocal()
22+
}
23+
1824
allprojects {
19-
version = "0.78.0"
25+
version = "0.78.2"
2026
group = "org.signal"
2127

2228
tasks.withType(KotlinCompile).configureEach {
@@ -45,25 +51,7 @@ subprojects {
4551
}
4652
}
4753

48-
apply plugin: "com.diffplug.spotless"
4954
apply plugin: "org.jetbrains.dokka"
50-
spotless {
51-
kotlin {
52-
target('**/*.kt')
53-
targetExclude("**/acknowledgments/**")
54-
ktlint()
55-
}
56-
java {
57-
target('**/*.java')
58-
targetExclude('**/Native.java', '**/NativeTesting.java')
59-
importOrder()
60-
removeUnusedImports()
61-
62-
googleJavaFormat()
63-
formatAnnotations()
64-
licenseHeaderFile rootProject.file('license_header.txt')
65-
}
66-
}
6755
}
6856

6957
task makeJniLibrariesDesktop(type:Exec) {
@@ -142,3 +130,32 @@ nexusPublishing {
142130
def isReleaseBuild() {
143131
return version.contains("SNAPSHOT") == false
144132
}
133+
134+
// Late evaluation after this point.
135+
136+
evaluationDependsOnChildren()
137+
138+
spotless {
139+
kotlin {
140+
target allprojects.collectMany {
141+
return it.tasks.withType(KotlinCompile)
142+
}.inject(files()) { collected, next ->
143+
collected + next.sources
144+
}
145+
ktlint()
146+
}
147+
java {
148+
target allprojects.collectMany {
149+
return it.tasks.withType(JavaCompile)
150+
}.inject(files()) { collected, next ->
151+
collected + next.source
152+
}
153+
targetExclude('**/Native.java', '**/NativeTesting.java')
154+
importOrder()
155+
removeUnusedImports()
156+
157+
googleJavaFormat()
158+
formatAnnotations()
159+
licenseHeaderFile rootProject.file('license_header.txt')
160+
}
161+
}

java/client/src/main/java/org/signal/libsignal/internal/Async.kt

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,24 @@ import kotlin.coroutines.resumeWithException
1919
* @throws Exception if the CompletableFuture completed exceptionally
2020
* @throws CancellationException if the coroutine was cancelled
2121
*/
22-
public suspend fun <T> CompletableFuture<T>.await(): T = suspendCancellableCoroutine { c ->
23-
// From https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-cancellable-continuation/
24-
val future = this
25-
future.whenComplete { result, throwable ->
26-
if (throwable != null) {
27-
// Resume continuation with an exception if an external source failed
28-
c.resumeWithException(throwable)
29-
} else {
30-
// Resume continuation with a value if it was computed
31-
c.resume(result)
22+
public suspend fun <T> CompletableFuture<T>.await(): T =
23+
suspendCancellableCoroutine { c ->
24+
// From https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-cancellable-continuation/
25+
val future = this
26+
future.whenComplete { result, throwable ->
27+
if (throwable != null) {
28+
// Resume continuation with an exception if an external source failed
29+
c.resumeWithException(throwable)
30+
} else {
31+
// Resume continuation with a value if it was computed
32+
c.resume(result)
33+
}
34+
}
35+
// Cancel the computation if the continuation itself was cancelled because a caller of 'await' is cancelled
36+
c.invokeOnCancellation {
37+
future.cancel(true)
3238
}
3339
}
34-
// Cancel the computation if the continuation itself was cancelled because a caller of 'await' is cancelled
35-
c.invokeOnCancellation {
36-
future.cancel(true)
37-
}
38-
}
3940

4041
/**
4142
* Converts a `CompletableFuture<T>` to a `CompletableFuture<Result<T>>`.
@@ -48,12 +49,11 @@ public suspend fun <T> CompletableFuture<T>.await(): T = suspendCancellableCorou
4849
*
4950
* @return A new CompletableFuture that completes with `Result.success(value)` or `Result.failure(exception)`
5051
*/
51-
public fun <T> CompletableFuture<T>.toResultFuture(): CompletableFuture<Result<T>> {
52-
return this.handle { value, throwable ->
52+
public fun <T> CompletableFuture<T>.toResultFuture(): CompletableFuture<Result<T>> =
53+
this.handle { value, throwable ->
5354
if (throwable == null) {
5455
Result.success(value)
5556
} else {
5657
Result.failure(throwable)
5758
}
5859
}
59-
}

0 commit comments

Comments
 (0)