(messageIds)
| 438 | // --- Public API: status updates --- |
| 439 | |
| 440 | ack(messageIds) { |
| 441 | const ids = Array.isArray(messageIds) ? messageIds : [messageIds]; |
| 442 | let count = 0; |
| 443 | for (const id of ids) { |
| 444 | const msg = this._messages.get(id); |
| 445 | if (msg && msg.direction === 'inbound') { |
| 446 | this._appendUpdate(id, { status: 'delivered' }); |
| 447 | this._evictFromIndex(id); |
| 448 | count++; |
| 449 | } |
| 450 | } |
| 451 | return count; |
| 452 | } |
| 453 | |
| 454 | updateStatus(id, status, { error, syncedAt } = {}) { |
| 455 | const TERMINAL = new Set(['synced', 'delivered', 'failed', 'rejected']); |
no test coverage detected