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

Read markers no longer automatically update #12981

Closed
waylon531 opened this issue Jun 8, 2022 · 5 comments
Closed

Read markers no longer automatically update #12981

waylon531 opened this issue Jun 8, 2022 · 5 comments

Comments

@waylon531
Copy link
Contributor

waylon531 commented Jun 8, 2022

Description

Read markers have stopped updating for the bots on my server. Previously, they were configured to keep their marker at the last sent message in the room. This no longer works and the read marker is always at the last message the bot has sent.

This is using the Rust crate matrix_bot_api.

Steps to reproduce

Run one of my matrix bots (that I can upload the source to if needed) OR

Run the same HTTP requests the bot makes to make this happen:

Make a POST request to https://riot.firechicken.net/_matrix/client/r0/rooms/!HuzZYsRDedSlARruIP:riot.firechicken.net/receipt/m.read/$7bpnSeb8J5rbAQiweFv_Oqx-IEpvFqxXdrk3x3uYnZ8?access_token=<redacted>
^ This one is sent with an empty body, and gets a 400 status code. However, sending a curl post request with a body of "{}" does make it 200 but it doesn't appear to make for any different behaviour as far as the read marker is concerned.

Make a POST request to https://riot.firechicken.net/_matrix/client/r0/rooms/!HuzZYsRDedSlARruIP:riot.firechicken.net/read_markers?access_token=<redacted> with the body

{
    "m.fully_read": "$AFHiuKgyzjUVhQYcZPRCetiVorsxRmF4N2gbE1r3DZM",
    "m.read": null
}

I think this should be sufficient to update the read marker, but nothing happens. The bot also runs a https://riot.firechicken.net/_matrix/client/r0/sync after this.

Version information

  • Homeserver: riot.firechicken.net

If not matrix.org:

  • Version: Synapse 1.51.0

  • Install method: pip

  • Platform: CentOS
@waylon531
Copy link
Contributor Author

I think the broken call to https://riot.firechicken.net/_matrix/client/r0/rooms/!HuzZYsRDedSlARruIP:riot.firechicken.net/receipt/m.read/$7bpnSeb8J5rbAQiweFv_Oqx-IEpvFqxXdrk3x3uYnZ8 may be what's causing the issue but I'm not sure why upgrading synapse would make that matter. There are a lot of changes I pulled in though as I hadn't upgraded synapse for quite a while beforehand, since around the release of v6 rooms.

@clokep
Copy link
Member

clokep commented Jun 8, 2022

Do you get a 200 response back from that call?

My initial thought was this could be related to the private read receipts feature, but I don't believe that was in Synapse 1.51.0.

@reivilibre
Copy link
Contributor

reivilibre commented Jun 8, 2022

Thanks for the details about what requests you're making, that should be useful. I'd like some logs, please (ideally at DEBUG or INFO level), showing the bot's requests to set a read receipt and what response code is being sent.

This one is sent with an empty body, and gets a 400 status code.

This is the main thing that comes to mind: you should send a {} body (an empty body is NOT spec-compliant; Synapse 'recently' changed to not allow these #12709 & #11157).

The other thing I wonder: is it valid to send "m.read": null? I don't get that impression from the spec
Synapse is not usually very good about enforcing these things, but it'd be good to see if that's related, so I'd try by omitting that field altogether.

@waylon531
Copy link
Contributor Author

Synapse 'recently' changed to not allow these #12709 & #11157

Looks like it was that! I've reverted that code change for now. At some point I might take a shot at fixing the rust bot library I use, and updating my riot patchset, but it's very simple to allow empty bodies again. Thanks!

@reivilibre
Copy link
Contributor

At some point I might take a shot at fixing the rust bot library I use, and updating my riot patchset, but it's very simple to allow empty bodies again. Thanks!

Thanks for checking it was that and getting back to us.
To fix the library, it's probably something as simple as .json(()) if it's similar to reqwest.
If you get the chance, you may well save someone else the trouble :D.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants