File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed
SignalServiceKit/Backups/Archiving Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -286,6 +286,10 @@ public class BackupArchiveManagerImpl: BackupArchiveManager {
286286 try await fetchRemoteSVR🐝ForwardSecrecyToken ( key: key, auth: chatAuth)
287287 } catch SVR🐝Error . unrecoverable {
288288 // Not found, so consider a success and fallthrough
289+ Logger . info ( " SVR🐝 not found, skipping restore. " )
290+ } catch {
291+ Logger . warn ( " Encountered error restoring SVR🐝: \( error) " )
292+ throw error
289293 }
290294
291295 await db. awaitableWrite {
@@ -1562,10 +1566,16 @@ public class BackupArchiveManagerImpl: BackupArchiveManager {
15621566 chatServiceAuth: auth
15631567 )
15641568
1565- let metadataHeader = try await backupCdnInfo (
1566- backupKey: key,
1567- backupAuth: backupServiceAuth
1568- ) . metadataHeader
1569+ let metadataHeader : BackupNonce . MetadataHeader
1570+ do {
1571+ metadataHeader = try await backupCdnInfo (
1572+ backupKey: key,
1573+ backupAuth: backupServiceAuth
1574+ ) . metadataHeader
1575+ } catch let error as OWSHTTPError where error. responseStatusCode == 404 {
1576+ // If no backup is found, treat this as unrecoverable
1577+ throw SVR🐝Error . unrecoverable
1578+ }
15691579
15701580 let nonceSource = BackupImportSource . NonceMetadataSource. svr🐝 ( header: metadataHeader, auth: auth)
15711581 let source = BackupImportSource . remote ( key: key, nonceSource: nonceSource)
You can’t perform that action at this time.
0 commit comments