Skip to content

Matrix-side topic changes aren't stored in DataStore #1845

@f0x52

Description

@f0x52

Note: this is only an issue on Postgresql backed bridges, as nedb never properly uses a stored topic at all.

IRC topic changes (from non-virtual IRC users) are stored in the DataStore after reflecting the change in the Matrix room.
On subsequent topic changes, this topic is queried from the DataStore, to short-circuit the serviceTopicQueue function when the update is the same as the current topic:

private async serviceTopicQueue (item: TopicQueueItem) {
const promises = item.matrixRooms.map((matrixRoom) => {
if (matrixRoom.topic === item.topic) {
item.req.log.info(
"Topic of %s already set to '%s'",
matrixRoom.getId(),
item.topic
);

Topic changes by Matrix users are never stored in this same database, neither in MatrixHandler when they get bridged to IRC, nor when those topic changes come back through the IrcHandler (as it comes from a virtual user).
Given the following changes:

IRC user: Topic A
Matrix user: Topic B
IRC user: Topic A

The expected topic in the Matrix room would be Topic A, but because the database never stored Topic B, it still thinks the topic was Topic A, and ignores the last IRC update.

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