Skip to content

No event when sync failed, Bot stuck on 'Expect String but received undefined' #346

Open
@liemlylac

Description

@liemlylac

Request related to a problem: Expect String but received undefined.
I have a list of bot clients and want to stress test bot sends encrypted messages to e2ee rooms.
When running a stress test using Postman by using 10 bots to send messages to 10 rooms.
Virtual user: 100, ramp-up duration: 2 minutes, request duration: 5 minutes.
The total requests for every bot is ~1,5K.

MatrixClientLite shows the error: Expect String but received Undefined.
Tracking error I found this is an error from matrix-rust-sdk-crypto-nodejs when returning the empty request object (without txn_id will throw exception).
Sometimes I get the error: Invalid access token passed. from MatrixHttpClient.

-> Maybe a lot of events fired and Bot's clients cannot sync up to date.

After restarting all bot clients, no error can be found.
I can't find any event to handle on "sync" error to detect error caused and handle restarting bot or get a new access_token for the bot client.

The solution
Could you please add code like this.emit('sync.error', e) on catch() when sync failed?

Alternatives solution
A better way is to resolve the error Expect String but received Undefined. Does update matrix-rust-sdk-crypto-nodejs dependencies to 0.1.0-beta.11 will resolve it?

Additional context
I using matrix-bot-sdk: v0.6.6.
NodeJs: v16.x

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions