( sqliteQueryExecutor: SQLiteQueryExecutorWrapper, operations: $ReadOnlyArray<ClientDBThreadStoreOperation>, module: EmscriptenModule, )
| 105 | } |
| 106 | |
| 107 | function processThreadStoreOperations( |
| 108 | sqliteQueryExecutor: SQLiteQueryExecutorWrapper, |
| 109 | operations: $ReadOnlyArray<ClientDBThreadStoreOperation>, |
| 110 | module: EmscriptenModule, |
| 111 | ) { |
| 112 | for (const operation: ClientDBThreadStoreOperation of operations) { |
| 113 | try { |
| 114 | if (operation.type === 'remove_all') { |
| 115 | sqliteQueryExecutor.removeAllThreads(); |
| 116 | } else if (operation.type === 'remove') { |
| 117 | const { ids } = operation.payload; |
| 118 | sqliteQueryExecutor.removeThreads(ids); |
| 119 | } else if (operation.type === 'replace') { |
| 120 | sqliteQueryExecutor.replaceThread( |
| 121 | clientDBThreadInfoToWebThread(operation.payload), |
| 122 | operation.isBackedUp, |
| 123 | ); |
| 124 | } else { |
| 125 | throw new Error('Unsupported thread operation'); |
| 126 | } |
| 127 | } catch (e) { |
| 128 | throw new Error( |
| 129 | `Error while processing ${ |
| 130 | operation.type |
| 131 | } thread operation: ${getProcessingStoreOpsExceptionMessage( |
| 132 | e, |
| 133 | module, |
| 134 | )}`, |
| 135 | ); |
| 136 | } |
| 137 | } |
| 138 | } |
| 139 | |
| 140 | function processKeyserverStoreOperations( |
no test coverage detected