Skip to content

Commit 9e2bcb2

Browse files
committed
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.)
1 parent bbf4d7a commit 9e2bcb2

File tree

4 files changed

+31
-16
lines changed

4 files changed

+31
-16
lines changed

java/client/src/main/java/org/signal/libsignal/net/SvrB.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public class SvrB internal constructor(
117117
* - [Result.failure] containing [RetryLaterException] if the server is rate limiting this client.
118118
* This is **retryable** after waiting the designated delay.
119119
* - [Result.failure] containing [NetworkException] if the network operation fails (connection,
120-
* service, or timeout errors). These are **retryable**.
120+
* service, or timeout errors). These can be **automatically retried** (backoff recommended).
121121
* - [Result.failure] containing [NetworkProtocolException] if there is a protocol error. This
122122
* indicates a possible bug in libsignal or in the enclave.
123123
* - [Result.failure] containing
@@ -191,7 +191,7 @@ public class SvrB internal constructor(
191191
* - [Result.failure] containing [RetryLaterException] if the server is rate limiting this client.
192192
* This is **retryable** after waiting the designated delay.
193193
* - [Result.failure] containing [NetworkException] if the network operation fails (connection,
194-
* service, or timeout errors). These are **retryable**.
194+
* service, or timeout errors). These can be **automatically retried** (backoff recommended).
195195
* - [Result.failure] containing [NetworkProtocolException] if there is a protocol error. This
196196
* indicates a possible bug in libsignal or in the enclave.
197197
* - [Result.failure] containing
@@ -249,7 +249,7 @@ public class SvrB internal constructor(
249249
* - [Result.failure] containing [RetryLaterException] if the server is rate limiting this client.
250250
* This is **retryable** after waiting the designated delay.
251251
* - [Result.failure] containing [NetworkException] if the network operation fails (connection,
252-
* service, or timeout errors). These are **retryable**.
252+
* service, or timeout errors). These can be **automatically retried** (backoff recommended).
253253
* - [Result.failure] containing [NetworkProtocolException] if there is a protocol error. This
254254
* indicates a possible bug in libsignal or in the enclave.
255255
* - [Result.failure] containing

node/ts/net/SvrB.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,8 @@ export class SvrB {
228228
* @throws {RateLimitedError} if the server is rate limiting this client. This is **retryable**
229229
* after waiting the designated delay.
230230
* @throws {IoError} if the network operation fails (connection, service, or timeout errors).
231-
* These are **retryable**, but some may indicate a possible bug in libsignal or in the enclave.
231+
* These can be **automatically retried** (backoff recommended), but some may indicate a possible
232+
* bug in libsignal or in the enclave.
232233
* @throws {SvrAttestationError} if enclave attestation fails. This indicates a possible bug in
233234
* libsignal or in the enclave.
234235
*/
@@ -281,7 +282,8 @@ export class SvrB {
281282
* @throws {RateLimitedError} if the server is rate limiting this client. This is **retryable**
282283
* after waiting the designated delay.
283284
* @throws {IoError} if the network operation fails (connection, service, or timeout errors).
284-
* These are **retryable**, but some may indicate a possible bug in libsignal or in the enclave.
285+
* These can be **automatically retried** (backoff recommended), but some may indicate a possible
286+
* bug in libsignal or in the enclave.
285287
* @throws {SvrAttestationError} if enclave attestation fails. This indicates a possible bug in
286288
* libsignal or in the enclave.
287289
*/
@@ -309,9 +311,9 @@ export class SvrB {
309311
/**
310312
* Attempts to remove the info stored with SVR-B for this particular username/password pair.
311313
*
312-
* This is a best-effort operation; a successful return means the data has been removed from
313-
* (or never was present in) the current SVR-B enclaves, but may still be present in previous
314-
* ones that have yet to be decommissioned. Conversely, a thrown error may still have removed
314+
* This is a best-effort operation; a successful return means the data has been removed from (or
315+
* never was present in) the current SVR-B enclaves, but may still be present in previous ones
316+
* that have yet to be decommissioned. Conversely, a thrown error may still have removed
315317
* information from previous enclaves.
316318
*
317319
* This should not typically be needed; rather than explicitly removing an entry, the client
@@ -322,7 +324,8 @@ export class SvrB {
322324
* @throws {RateLimitedError} if the server is rate limiting this client. This is **retryable**
323325
* after waiting the designated delay.
324326
* @throws {IoError} if the network operation fails (connection, service, or timeout errors).
325-
* These are **retryable**, but some may indicate a possible bug in libsignal or in the enclave.
327+
* These can be **automatically retried** (backoff recommended), but some may indicate a possible
328+
* bug in libsignal or in the enclave.
326329
* @throws {SvrAttestationError} if enclave attestation fails. This indicates a possible bug in
327330
* libsignal or in the enclave.
328331
*/

rust/bridge/shared/types/src/ffi/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -974,7 +974,7 @@ impl FfiError for libsignal_net::svrb::Error {
974974
}
975975
Self::Connect(e) => match e {
976976
WebSocketConnectError::Transport(e) => format!("IO error: {e}").into(),
977-
WebSocketConnectError::WebSocketError(_) => format!("WebSocket error: {e}").into(),
977+
WebSocketConnectError::WebSocketError(e) => format!("WebSocket error: {e}").into(),
978978
},
979979
Self::RateLimited(inner) => inner.describe(),
980980
Self::Service(e) => format!("WebSocket error: {e}").into(),

swift/Sources/LibSignalClient/SecureValueRecoveryBackup.swift

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,12 @@ public class SvrB {
119119
/// choice here but to **start a new chain**.
120120
/// - ``SignalError/rateLimitedError(retryAfter:message:)`` if the server is rate limiting
121121
/// this client. This is **retryable** after waiting the designated delay.
122-
/// - Other ``SignalError``s for networking and attestation issues. These are **retryable**,
123-
/// but some may indicate a possible bug in libsignal or in the enclave.
122+
/// - ``SignalError/connectionFailed(_:)``, ``SignalError/ioError(_:)``, or
123+
/// ``SignalError/webSocketError(_:)`` for networking failures before and during
124+
/// communication with the server. These can be **automatically retried** (backoff
125+
/// recommended).
126+
/// - Other ``SignalError``s for networking and attestation issues. These can be manually
127+
/// retried, but some may indicate a possible bug in libsignal or in the enclave.
124128
public func store(
125129
backupKey: BackupKey,
126130
previousSecretData: Data
@@ -174,8 +178,12 @@ public class SvrB {
174178
/// recoverable).
175179
/// - ``SignalError/rateLimitedError(retryAfter:message:)`` if the server is rate limiting
176180
/// this client. This is **retryable** after waiting the designated delay.
177-
/// - Other ``SignalError``s for networking and attestation issues. These are **retryable**,
178-
/// but some may indicate a possible bug in libsignal or in the enclave.
181+
/// - ``SignalError/connectionFailed(_:)``, ``SignalError/ioError(_:)``, or
182+
/// ``SignalError/webSocketError(_:)`` for networking failures before and during
183+
/// communication with the server. These can be **automatically retried** (backoff
184+
/// recommended).
185+
/// - Other ``SignalError``s for networking and attestation issues. These can be manually
186+
/// retried, but some may indicate a possible bug in libsignal or in the enclave.
179187
public func restore(
180188
backupKey: BackupKey,
181189
metadata: Data
@@ -216,8 +224,12 @@ public class SvrB {
216224
/// - Throws:
217225
/// - ``SignalError/rateLimitedError(retryAfter:message:)`` if the server is rate limiting
218226
/// this client. This is **retryable** after waiting the designated delay.
219-
/// - Other ``SignalError``s for networking and attestation issues. These are **retryable**,
220-
/// but some may indicate a possible bug in libsignal or in the enclave.
227+
/// - ``SignalError/connectionFailed(_:)``, ``SignalError/ioError(_:)``, or
228+
/// ``SignalError/webSocketError(_:)`` for networking failures before and during
229+
/// communication with the server. These can be **automatically retried** (backoff
230+
/// recommended).
231+
/// - Other ``SignalError``s for networking and attestation issues. These can be manually
232+
/// retried, but some may indicate a possible bug in libsignal or in the enclave.
221233
public func remove() async throws {
222234
let _: Bool = try await self.net.asyncContext.invokeAsyncFunction {
223235
promise,

0 commit comments

Comments
 (0)