Skip to content

Events can be processed out of order #510

Description

@debdutdeb

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions