Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Correctly read to-device stream pos on SQLite #16682

Merged
merged 3 commits into from
Nov 24, 2023
Merged

Conversation

DMRobertson
Copy link
Contributor

@DMRobertson DMRobertson commented Nov 23, 2023

Fixes #16681.

Commitwise reviewable. Completely untested.

I also threw in an opinionated rename in the last commit.

@DMRobertson DMRobertson marked this pull request as ready for review November 23, 2023 19:23
@DMRobertson DMRobertson requested a review from a team as a code owner November 23, 2023 19:23
Copy link
Member

@erikjohnston erikjohnston left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems legit, though I don't quite understand how this is limited to SQLite

tables=[
("device_inbox", "instance_name", "stream_id"),
("device_federation_outbox", "instance_name", "stream_id"),
],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't we see a problem on postgres then?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because postgres uses a sequence in the DB to generate the IDs. This list of tables is only for enforcing consistency with that sequence at startup time.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah!

@DMRobertson DMRobertson merged commit c3627d0 into develop Nov 24, 2023
41 checks passed
@DMRobertson DMRobertson deleted the dmr/to-device-stream branch November 24, 2023 13:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Running under sqlite, Synapse incorrectly populates the to-device messages current stream ID
2 participants