()
| 383 | } |
| 384 | |
| 385 | function readMessages() { |
| 386 | try { |
| 387 | return uniqMessages([ |
| 388 | ...JSON.parse(getChunkedConfig('chunkedSyncDataLocal') || '[]'), |
| 389 | ...JSON.parse(getChunkedConfig('chunkedSyncData') || '[]') |
| 390 | ]); |
| 391 | } |
| 392 | catch(error) { |
| 393 | log('failed to read messages: ', error); |
| 394 | return []; |
| 395 | } |
| 396 | } |
| 397 | |
| 398 | function writeMessages(messages) { |
| 399 | const stringified = JSON.stringify(messages || []); |
no test coverage detected