Commit Graph

856 Commits

Author SHA1 Message Date
Jordan Rose
9e2bcb2a74 SVRB: Distinguish "automatic retry" from "manual retry" errors
- Java: This distinction is already made, just reworded

- Node: We include "protocol errors" in IoError here, where retrying
  probably won't help, but it won't really be harmful either.

- Swift: Automatically retryable errors are now enumerated; other
  errors are still described as "manually retryable". (Also, fixed a
  redundant error message format call.)
2025-08-14 16:14:12 -07:00
Jordan Rose
54e81cda4f java: System.runFinalization() in GC cleanup testing
This makes this particular test more reliable even though no
'finalize' methods are involved in this one.
2025-08-13 13:31:23 -07:00
Jordan Rose
b4cd040474 Add SvrB.remove(), use it for app-level integration tests 2025-08-13 12:35:52 -07:00
Jordan Rose
374301ab46 java: Include a timestamp in the testing StderrLogger
Before
> I libsignal: rust/bridge/shared/types/src/net.rs:132: Initializing connection manager for Staging...

After
> [11:03:32.956965 libsignal] I rust/bridge/shared/types/src/net.rs:132: Initializing connection manager for Staging...
2025-08-13 11:43:12 -07:00
Jordan Rose
7bae76f25e java: Use the slightly-nicer StderrLogger in TestLogger 2025-08-13 11:43:12 -07:00
Jordan Rose
996f6bb250 jni: explicitly clean up local refs on background threads
- Use a local frame for bridge_io when completing futures
- Use a local frame for ChatListener callbacks
- Use AutoLocal for exception formatting callbacks
2025-08-12 10:49:30 -07:00
moiseev-signal
b53ed51263 keytrans: Stop falling back to search if _self_ monitor detects a new version 2025-08-11 15:34:01 -07:00
Alex Bakon
1f923dcd88 Remove unused TransportConnectError::DnsError 2025-08-11 09:45:02 -04:00
Jordan Rose
ea343a89ab jni: Native.java -> Native.kt
Improvements included in this first iteration:
- Nullable/non-nullable!
- ObjectHandle typealias for Long
- Fixed handling for CompletableFuture<Void> (previously translated
  without generics at all in some cases)

Co-authored-by: Alex Bakon <akonradi@signal.org>
2025-08-08 14:41:22 -07:00
Jordan Rose
1d67bed3ed Gradle: Consolidate allprojects + subprojects down to one block 2025-08-08 14:40:35 -07:00
Jordan Rose
969f9304a5 Reset for version v0.78.3 2025-08-08 14:20:19 -07:00
Jordan Rose
36916db152 Gradle: Make Spotless a top-level task, be precise about inputs
Previously, we used a per-project directory glob for Kotlin and Java
sources, which (1) was overly general, (2) ran afoul of Gradle's rules
about "if you look in a directory you must depend on it", and (3)
required us to make a fake subproject in the shared/ folder because
Spotless doesn't like sources outside the project directory.

Now, we delay complete evaluation of the root project until
subprojects are complete, and then add a single Spotless operation at
the top level that uses the subprojects' compile tasks to find exactly
the files to format.
2025-08-08 13:08:31 -07:00
Jordan Rose
fd8322b53e SVRB: Clarify what "chain" refers to in the doc comments 2025-08-07 17:28:02 -07:00
Jordan Rose
51a4bfa614 Gradle: drop leftover support for building with a pre-11 JDK 2025-08-07 15:58:03 -07:00
Jordan Rose
aee436a43c java: Update Spotless to 7.2.1 2025-08-07 13:46:28 -07:00
Jordan Rose
d3112cc349 java: Provide (and document) more specific exceptions for SVR-B 2025-08-06 17:18:31 -07:00
Jordan Rose
3b91a5d708 net: Parse RetryLater info for SVR-B
Essentially, promotes "decide whether an HTTP status is interesting"
up to the generic "enclave" handling instead of being CDS-specific,
and then propagates the new case all the way out to apps.
2025-08-06 16:05:28 -07:00
Max Moiseev
a357e1c8f4 Reset for version v0.78.2 2025-08-06 11:28:06 -07:00
Jordan Rose
9feb3de9d2 net: SvrError::ConnectionTimeout -> AllConnectionAttemptsFailed
The same error is being used both for timeouts and for "all attempts
failed"; if we're going to coalesce them (reasonable, given that the
only option in either case is "retry" or "don't"), "all attempts
failed" is a less misleading choice.

This changes the particular enum case in Swift from connectionTimedOut
to connectionFailed. Java continues to use NetworkException and
TypeScript the IoError code.
2025-08-01 14:02:54 -07:00
Jordan Rose
59ce2f3f0c Reset for version v0.78.1 2025-07-31 14:00:29 -07:00
Jordan Rose
be9e9a3ab6 Expose SvrB.createNewBackupChain(), make secret data non-optional 2025-07-31 12:37:02 -07:00
andrew-signal
4cff0b3911 Remove the timeout from testToResultFutureCancellationPropagation so it flakes less. 2025-07-31 15:33:15 -04:00
gram-signal
72935510d4 Immediately after a restore, use the same enc_salt/pw_salt for the next backup.
Co-authored-by: Jordan Rose <jrose@signal.org>
2025-07-30 20:14:26 -07:00
Andrew
b76a09d9c7 Reset for version v0.77.2 2025-07-29 20:31:28 -04:00
andrew-signal
f9ca652baf Extend testToResultFutureCancellationPropagation baseFuture.await() timeout 2025-07-29 19:05:23 -04:00
Alex Bakon
bb05cc016e Streamline bridging of SVR-B function arguments 2025-07-29 14:18:16 -04:00
Andrew
b7ebe6833b Reset for version v0.77.1 2025-07-28 19:10:50 -04:00
andrew-signal
d70f913780 Skip non-hermetic SVR-B tests if username or password is not set 2025-07-28 18:51:30 -04:00
andrew-signal
3055e8e2b3 Bridge SVR-B to Kotlin 2025-07-28 18:05:13 -04:00
Jordan Rose
9e9c375db9 Expose BackupForwardSecrecyToken-aware MessageBackupKey derivation 2025-07-28 13:53:19 -07:00
andrew-signal
5bdc3e54f2 Expect correct kind of exception in testConnectCancellationUnauth 2025-07-25 19:31:43 -04:00
Alex Bakon
303b6313bd Expose SVR-B logic from Rust 2025-07-25 17:36:12 -04:00
Jordan Rose
d225a1008d Add CompletableFuture.handle
Co-authored-by: Andrew <andrew@signal.org>
2025-07-25 14:09:07 -07:00
Jordan Rose
a881fcf0f3 java: Align CompletableFuture cancellation behavior with OpenJDK's 2025-07-25 13:24:29 -07:00
gram-signal
3ae977841f Modify backup forward-secrecy-token storage to be more resilient to SVRB communication failures.
Co-authored-by: Alex Bakon <akonradi@signal.org>
2025-07-25 12:35:01 -07:00
andrew-signal
47a4eeabb5 Bridge BackupForwardSecrecyToken to Swift/Kotlin/TypeScript 2025-07-23 19:57:16 -04:00
andrew-signal
ec3c273219 Expose Rust API for SVR-B 2025-07-23 18:59:54 -04:00
Alex Bakon
c913c90aca Reset for version v0.76.8 2025-07-22 16:56:33 -04:00
Alex Bakon
7aef688310 Split Base64 utility to reduce reflection 2025-07-22 15:33:22 -04:00
Max Moiseev
fa287c9fdd Reset for version v0.76.7 2025-07-21 18:04:47 -07:00
Jordan Rose
69f1a54f0c Reset for version v0.76.6 2025-07-18 09:59:41 -07:00
Jordan Rose
821dee54e5 java: Add CompletableFuture.completedFuture()
Matches java.util.concurrent.CompletableFuture's method.
2025-07-17 18:27:39 -07:00
Jordan Rose
04e9d83995 MessageBackupValidationTest.java: "expected, actual" in assertEquals 2025-07-17 10:57:29 -07:00
Jordan Rose
0dc81d3131 backup: Replace bespoke TooShort with io::ErrorKind::UnexpectedEof 2025-07-17 10:57:29 -07:00
moiseev-signal
ca28564e0b java: Address deprecation warning in Curve25519Test 2025-07-16 11:26:31 -07:00
Jordan Rose
d3a54c3c19 java: Fix deprecated ENV syntax in Dockerfile 2025-07-15 18:20:13 -07:00
Jordan Rose
7489feaca4 java: Don't apply Kotlin plugins in the top-level project
Otherwise, IDEs can get confused, since our top-level project has no
'repositories' section.
2025-07-15 18:14:56 -07:00
Jordan Rose
bff304625f java: Only verify dependencies strictly in CI+Docker
Some IDEs download additional artifacts that a plain command-line
Gradle build won't use, which means Gradle won't automatically manage
them in verification-metadata.xml either. Compromise by only strictly
checking dependencies at certain boundaries, rather than on every
build action.
2025-07-15 16:34:29 -07:00
Jordan Rose
a410849578 crypto: Add a stripped-down HPKE API for our Curve25519 keys 2025-07-15 16:17:23 -07:00
andrew-signal
a323900858 Refactor so tests generate legacy key format encrypted file; client tests can use that. 2025-07-15 13:16:06 -04:00