This commit is contained in:
Bruno Windels 2021-05-31 15:55:31 +02:00
parent dc2e21495b
commit 25ce06c9d5

View file

@ -100,8 +100,9 @@ export class SendQueue {
if (pendingEvent.needsSending) { if (pendingEvent.needsSending) {
await pendingEvent.send(this._hsApi, log); await pendingEvent.send(this._hsApi, log);
// we now have a remoteId, but this pending event may be removed at any point in the future // we now have a remoteId, but this pending event may be removed at any point in the future
// once the remote echo comes in. So if we have any related events that need to resolve // (or past, so can't assume it still exists) once the remote echo comes in.
// the relatedTxnId to a related event id, they need to do so now. // So if we have any related events that need to resolve the relatedTxnId to a related event id,
// they need to do so now.
// We ensure this by writing the new remote id for the pending event and all related events // We ensure this by writing the new remote id for the pending event and all related events
// with unresolved relatedTxnId in the queue in one transaction. // with unresolved relatedTxnId in the queue in one transaction.
const txn = await this._storage.readWriteTxn([this._storage.storeNames.pendingEvents]); const txn = await this._storage.readWriteTxn([this._storage.storeNames.pendingEvents]);