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

Reduce duplication in event ordering lookup methods #8453

Closed
wants to merge 1 commit into from

Commits on Oct 5, 2020

  1. Reduce duplication in event ordering lookup methods

    `get_topological_token_for_event` and `get_event_ordering` were doing almost
    the same thing: the difference was only in the format of the result (`tuple` vs
    `RoomStreamOrdering`).
    
    This commit combines the two. `get_event_ordering` had a cache which may have
    been tuned so we stick with that name, but update it to return a
    `RoomStreamOrdering` for better type safety. We also put it in
    `StreamWorkerStore` rather than `EventsWorkerStore` since that's where all the
    other "ordering" methods are.
    
    So then we have to update all the places `get_topological_token_for_event` was
    called, to call `get_event_ordering` instead, and we have to update all the
    places `get_event_ordering` was called (just `is_event_after`) to handle
    `RoomStreamToken`s intstead of tuples.
    
    `is_event_after` was only called in once place and we may as well inline it.
    richvdh committed Oct 5, 2020
    Configuration menu
    Copy the full SHA
    9a3b3da View commit details
    Browse the repository at this point in the history