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

Factor out common code for persisting fetched auth events #10896

Commits on Sep 23, 2021

  1. Factor more stuff out of _get_events_and_persist

    It turns out that the event-sorting algorithm in `_get_events_and_persist` is
    also useful in other circumstances. Here we move the current
    `_auth_and_persist_fetched_events` to `_auth_and_persist_fetched_events_inner`,
    and then factor the sorting part out to `_auth_and_persist_fetched_events`.
    richvdh committed Sep 23, 2021
    Configuration menu
    Copy the full SHA
    fb4fe77 View commit details
    Browse the repository at this point in the history
  2. _get_remote_auth_chain_for_event: remove redundant outlier assign…

    …ment
    
    `get_event_auth` returns events with the outlier flag already set, so this is
    redundant (though we need to update a test where `get_event_auth` is mocked).
    richvdh committed Sep 23, 2021
    Configuration menu
    Copy the full SHA
    ff6056d View commit details
    Browse the repository at this point in the history
  3. _get_remote_auth_chain_for_event: move existing-event tests earlier

    Move a couple of tests outside the loop. This is a bit inefficient for now, but
    a future commit will make it better. It should be functionally identical.
    richvdh committed Sep 23, 2021
    Configuration menu
    Copy the full SHA
    e229a04 View commit details
    Browse the repository at this point in the history
  4. _get_remote_auth_chain_for_event: use `_auth_and_persist_fetched_ev…

    …ents`
    
    We can use the same codepath for persisting the events fetched as part of an
    auth chain as for those fetched individually by `_get_events_and_persist` for
    building the state at a backwards extremity.
    richvdh committed Sep 23, 2021
    Configuration menu
    Copy the full SHA
    c7c3e91 View commit details
    Browse the repository at this point in the history
  5. _get_remote_auth_chain_for_event: use a dict for efficiency

    `_auth_and_persist_fetched_events` sorts the events itself, so we no longer
    need to care about maintaining the ordering from `get_event_auth` (and no
    longer need to sort by depth in `get_event_auth`).
    
    That means that we can use a map, making it easier to filter out events we
    already have, etc.
    richvdh committed Sep 23, 2021
    Configuration menu
    Copy the full SHA
    867e76d View commit details
    Browse the repository at this point in the history
  6. changelog

    richvdh committed Sep 23, 2021
    Configuration menu
    Copy the full SHA
    bc20026 View commit details
    Browse the repository at this point in the history

Commits on Sep 24, 2021

  1. Configuration menu
    Copy the full SHA
    49d9802 View commit details
    Browse the repository at this point in the history