(
storeOperations: StoreOperations,
dbID: DatabaseIdentifier,
)
| 47 | removeAllOutboundP2PMessages: commCoreModule.removeAllOutboundP2PMessages, |
| 48 | |
| 49 | async processDBStoreOperations( |
| 50 | storeOperations: StoreOperations, |
| 51 | dbID: DatabaseIdentifier, |
| 52 | ): Promise<void> { |
| 53 | const keyserversToRemoveFromNotifsStore = |
| 54 | getKeyserversToRemoveFromNotifsStore( |
| 55 | storeOperations.keyserverStoreOperations ?? [], |
| 56 | ); |
| 57 | |
| 58 | try { |
| 59 | const promises = []; |
| 60 | if (keyserversToRemoveFromNotifsStore.length > 0) { |
| 61 | promises.push( |
| 62 | commCoreModule.removeKeyserverDataFromNotifStorage( |
| 63 | keyserversToRemoveFromNotifsStore, |
| 64 | ), |
| 65 | ); |
| 66 | } |
| 67 | |
| 68 | const dbOps = |
| 69 | convertStoreOperationsToClientDBStoreOperations(storeOperations); |
| 70 | if (values(dbOps).some(ops => ops && ops.length > 0)) { |
| 71 | promises.push(commCoreModule.processDBStoreOperations(dbOps, dbID)); |
| 72 | } |
| 73 | await Promise.all(promises); |
| 74 | } catch (e) { |
| 75 | if (isTaskCancelledError(e)) { |
| 76 | return; |
| 77 | } |
| 78 | // this code will make an entry in SecureStore and cause re-creating |
| 79 | // database when user will open app again |
| 80 | commCoreModule.reportDBOperationsFailure(); |
| 81 | commCoreModule.terminate(); |
| 82 | } |
| 83 | }, |
| 84 | |
| 85 | //backup |
| 86 | async restoreUserData(qrAuthBackupData: QRAuthBackupData): Promise<void> { |
nothing calls this directly
no test coverage detected