It seems like we can get into an out of order insertion of events into the in-memory queue.
The event is processed synchronously - https://github.com/matrix-org/matrix-appservice-node/blob/20b8fdc0f2c6acfd71638bc1d12fef0666b9cd6d/src/app-service.ts#L294
But bridge uses async callbacks, that can cause the actual insertion to defer.
for eeEventBroker -
|
if (this.eeEventBroker) { |
|
passthrough = await this.eeEventBroker.onASEvent(weakEvent); |
, enqueued here.
another possibility -
|
// Event rejected. |
|
if (!await this.validateEditEvent(event, relatesTo.event_id, editOptions.allowEventOnLookupFail)) { |
Am I missing some context while reading the code? Could someone please clarify?
It seems like we can get into an out of order insertion of events into the in-memory queue.
The
eventis processed synchronously - https://github.com/matrix-org/matrix-appservice-node/blob/20b8fdc0f2c6acfd71638bc1d12fef0666b9cd6d/src/app-service.ts#L294But bridge uses async callbacks, that can cause the actual insertion to defer.
for
eeEventBroker-matrix-appservice-bridge/src/bridge.ts
Lines 741 to 742 in 0998090
another possibility -
matrix-appservice-bridge/src/bridge.ts
Lines 1337 to 1338 in 0998090
Am I missing some context while reading the code? Could someone please clarify?