This repository was archived by the owner on Apr 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
POST /read_markers fails after history purge if cache is cleared #11738
Copy link
Copy link
Closed
Labels
S-MajorMajor functionality / product severely impaired, no satisfactory workaround.Major functionality / product severely impaired, no satisfactory workaround.T-DefectBugs, crashes, hangs, security vulnerabilities, or other reported issues.Bugs, crashes, hangs, security vulnerabilities, or other reported issues.
Description
Description
POST /read_markers fails when event at which m.fully_read points is cleared using history purge.
Steps to reproduce
- have a two rooms with two users joined each
- type messages in Element in first room with first user
- switch to second room
- send new events with second user
- purge history up to latest event in a first room
- restart synapse so that cache is cleared
- on first user switch to previous room
- POST /read_marker FAILS with 404
- sending new message doesn't modify read marker
Looks like the only current workaround is to edit database manually :/ If synapse is not restarted, event is fetched from cache and read marker can be edited
$ curl --location --request POST 'https://hs.stg.globekeeper.com/_matrix/client/r0/rooms/!DZjumzOmWaqeeaDKtc:hs.stg.globekeeper.com/read_markers' \
--header 'Authorization: Bearer SECRET' \
--header 'Content-Type: application/json' \
--data-raw '{
"m.fully_read": "$O8Mg-Vo5krkxojC1T0zf4q_h7k21s93qHbCnWVBFGAs"
}'
{"errcode":"M_UNKNOWN","error":"Could not find event $TV2s-Rsp0BWwTzWBHo-4FSCk-q0MAA5HfsHNi1ls4zo"}
m.fully_read points to non-existing event after history purge:
synapse1=# select * from room_account_data where user_id = '@tcayxbre:hs.stg.globekeeper.com' and room_id = '!DZjumzOmWaqeeaDKtc:hs.stg.globekeeper.com';
user_id | room_id | account_data_type | stream_id | content | instance_name
----------------------------------+--------------------------------------------+-------------------+-----------+------------------------------------------------------------+---------------
@tcayxbre:hs.stg.globekeeper.com | !DZjumzOmWaqeeaDKtc:hs.stg.globekeeper.com | m.fully_read | 4051 | {"event_id":"$TV2s-Rsp0BWwTzWBHo-4FSCk-q0MAA5HfsHNi1ls4zo"} |
(1 row)
synapse1=# select * from events where event_id = '$TV2s-Rsp0BWwTzWBHo-4FSCk-q0MAA5HfsHNi1ls4zo';
topological_ordering | event_id | type | room_id | content | unrecognized_keys | processed | outlier | depth | origin_server_ts | received_ts | sender | contains_url | instance_name | stream_ordering
----------------------+----------+------+---------+---------+-------------------+-----------+---------+-------+-----------------+-------------+--------+--------------+---------------+-----------------
(0 rows)
Version information
-
Homeserver: hs.stg.globekeeper.com
-
Version: 1.49.2 (with small, irrelevant modifications: https://github.com/globekeeper/synapse/commits/develop)
-
Install method:docker
-
Platform: GKE/containerd
michal-szarek, valerianglobekeeper, danpe, pepperoni666, ferologics and 3 moremichal-szarek, valerianglobekeeper, danpe, pepperoni666, ferologics and 3 more
Metadata
Metadata
Assignees
Labels
S-MajorMajor functionality / product severely impaired, no satisfactory workaround.Major functionality / product severely impaired, no satisfactory workaround.T-DefectBugs, crashes, hangs, security vulnerabilities, or other reported issues.Bugs, crashes, hangs, security vulnerabilities, or other reported issues.