Skip to content

Refresh last event on initial sync can cause excessive requests to synapse /messages endpoint for rooms with custom events #2286

Description

@ggurdin

Checklist

  • I could not find a solution in the documentation, the existing issues or discussions.
  • I already asked for help in the chat

In which Project did the bug appear?

Other

If you selected "Other" as Project, please enter in which project the bug occurred.

No response

On which platform did the bug appear?

Chrome

SDK Version

6.1.1

Describe the problem caused by this bug

I'm working with a project that sends many custom matrix events, so it's common for room's initial sync data to only contain these event types. These are not valid roomPreviewLastEvents, so many rooms have a null lastEvent when refreshLastEvent is called at the end of _handleRooms. This results in an excessive number of calls to the /messages endpoint to manually refresh this value for each room.

Steps To Reproduce

This may be tricky to reproduce, since it's caused by the number of custom events.

  1. Log into an account that's in many rooms. These room's recent events should not be valid roomPreviewLastEvents
  2. The SDK will make a request to the /messages endpoint for each of these rooms

Screenshots or Logs

No response

Security related

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions