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

Make pagination of rooms in admin api stable #11737

Merged
merged 5 commits into from
Jan 17, 2022

Commits on Jan 13, 2022

  1. Make pagination of rooms in admin api stable

    Always add state.room_id after the configurable ORDER BY. Otherwise,
    for any sort, certain pages can contain results from
    other pages. (Especially when sorting by creator, since there may
    be many rooms by the same creator)
    
    Signed-off-by: Daniël Sonck <daniel@sonck.nl>
    Daniel Sonck authored and dsonck92 committed Jan 13, 2022
    Configuration menu
    Copy the full SHA
    942a055 View commit details
    Browse the repository at this point in the history
  2. Fix failing tests

    Fix test by checking against a sorted room_id array. If there are multiple
    rooms with equal order_by values, individual rooms that share this same
    value are ordered by room_id. "version", "creator", "encryption"
    "federatable", "join_rules", "guest_access", "history_visibility" all
    have multiple rooms with the same value, thus need this specifically
    ordered id list.
    dsonck92 committed Jan 13, 2022
    Configuration menu
    Copy the full SHA
    2fdeced View commit details
    Browse the repository at this point in the history
  3. Sort tie-breaker with requested direction

    When the direction is changed of the sort to descending, also apply this
    to the tie-breaker based on room_id. This makes the whole list flip as
    would be expected.
    
    Signed-off-by: Daniel Sonck <daniel@sonck.nl>
    dsonck92 committed Jan 13, 2022
    Configuration menu
    Copy the full SHA
    d2e595f View commit details
    Browse the repository at this point in the history
  4. Fix codestyle for "history_visibility".

    Line can be on 1 line due to sorted_by_room_id_desc being shorter than
    the array.
    
    Signed-off-by: Daniel Sonck <daniel@sonck.nl>
    dsonck92 committed Jan 13, 2022
    Configuration menu
    Copy the full SHA
    93a1ecf View commit details
    Browse the repository at this point in the history

Commits on Jan 14, 2022

  1. Document different order direction of numerical fields

    "joined_members", "joined_local_members", "version" and "state_events"
    are ordered in descending direction by default (dir=f). Added a note
    in tests to explain the differences in ordering.
    
    Signed-off-by: Daniel Sonck <daniel@sonck.nl>
    dsonck92 committed Jan 14, 2022
    Configuration menu
    Copy the full SHA
    4d15a5d View commit details
    Browse the repository at this point in the history