mirror of
https://github.com/element-hq/synapse.git
synced 2026-08-17 02:20:30 +00:00
Regression test for a room linked from two spaces: the room is queued once per edge (the queue is only deduplicated when popped), each entry carrying the via and depth to summarise that edge with, and an entry queued later is popped first. Keying the prefetches by room id alone meant the popped entry could consume a summary computed for a different edge - summarising with the wrong via (so a room reachable only via the other parent is dropped from the hierarchy) or the wrong depth (so a room at max_depth is returned with children_state). Iterating the prefetch window in pop order, as the previous commit did, is not sufficient on its own: the entry for the shallower edge can be prefetched on an earlier iteration, before the deeper edge is queued at all. Track the entry each prefetch was started for and recompute when it is not the one popped. The test fails without the entry check (the room is summarised via the root's dead via and disappears from the hierarchy).