Skip to content
Snippets Groups Projects
  1. Sep 29, 2021
  2. Sep 24, 2021
    • Patrick Cloke's avatar
    • Richard van der Hoff's avatar
      Factor out common code for persisting fetched auth events (#10896) · 85551b7a
      Richard van der Hoff authored
      * 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`.
      
      * `_get_remote_auth_chain_for_event`: remove redundant `outlier` assignment
      
      `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).
      
      * `_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.
      
      * `_get_remote_auth_chain_for_event`: use `_auth_and_persist_fetched_events`
      
      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.
      
      * `_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.
      
      * changelog
      
      * `_auth_and_persist_fetched_events`: improve docstring
      85551b7a
    • David Robertson's avatar
      Improve typing in user_directory files (#10891) · 7f335274
      David Robertson authored
      
      * Improve typing in user_directory files
      
      This makes the user_directory.py in storage pass most of mypy's
      checks (including `no-untyped-defs`). Unfortunately that file is in the
      tangled web of Store class inheritance so doesn't pass mypy at the moment.
      
      The handlers directory has already been mypyed.
      
      Co-authored-by: default avatarreivilibre <olivier@librepush.net>
      7f335274
  3. Sep 23, 2021
  4. Sep 21, 2021
    • Patrick Cloke's avatar
      4054dfa4
    • David Robertson's avatar
      Always add local users to the user directory (#10796) · 60453315
      David Robertson authored
      
      It's a simplification, but one that'll help make the user directory logic easier
      to follow with the other changes upcoming. It's not strictly required for those
      changes, but this will help simplify the resulting logic that listens for
      `m.room.member` events and generally make the logic easier to follow.
      
      This means the config option `search_all_users` ends up controlling the
      search query only, and not the data we store. The cost of doing so is an
      extra row in the `user_directory` and `user_directory_search` tables for
      each local user which
      
      - belongs to no public rooms
      - belongs to no private rooms of size ≥ 2
      
      I think the cost of this will be marginal (since they'll already have entries
       in `users` and `profiles` anyway).
      
      As a small upside, a homeserver whose directory was built with this
      change can toggle `search_all_users` without having to rebuild their
      directory.
      
      Co-authored-by: default avatarRichard van der Hoff <1389908+richvdh@users.noreply.github.com>
      60453315
  5. Sep 10, 2021
  6. Sep 06, 2021
  7. Sep 01, 2021
  8. Aug 27, 2021
    • Richard van der Hoff's avatar
      Fix incompatibility with Twisted < 21. (#10713) · 8f982605
      Richard van der Hoff authored
      Turns out that the functionality added in #10546 to skip TLS was incompatible
      with older Twisted versions, so we need to be a bit more inventive.
      
      Also, add a test to (hopefully) not break this in future. Sadly, testing TLS is
      really hard.
      8f982605
  9. Aug 26, 2021
  10. Aug 19, 2021
  11. Aug 17, 2021
  12. Aug 16, 2021
  13. Aug 11, 2021
  14. Aug 10, 2021
  15. Aug 09, 2021
  16. Aug 05, 2021
  17. Jul 29, 2021
    • Eric Eastwood's avatar
      Fix backfilled events being rejected for no `state_groups` (#10439) · db6e7f15
      Eric Eastwood authored
      Reproducible on a federated homeserver when there is a membership auth event as a floating outlier. Then when we try to backfill one of that persons messages, it has missing membership auth to fetch which caused us to mistakenly replace the `context` for the message with that of the floating membership `outlier` event. Since `outliers` have no `state` or `state_group`, the error bubbles up when we continue down the persisting route: `sqlite3.IntegrityError: NOT NULL constraint failed: event_to_state_groups.state_group`
      
      Call stack:
      
      ```
      backfill
      _auth_and_persist_event
      _check_event_auth
      _update_auth_events_and_context_for_auth
      ```
      db6e7f15
  18. Jul 28, 2021
  19. Jul 27, 2021
  20. Jul 13, 2021
    • Patrick Cloke's avatar
      Show all joinable rooms in the spaces summary. (#10298) · 2d16e69b
      Patrick Cloke authored
      Previously only world-readable rooms were shown. This means that
      rooms which are public, knockable, or invite-only with a pending invitation,
      are included in a space summary. It also applies the same logic to
      the experimental room version from MSC3083 -- if a user has access
      to the proper allowed rooms then it is shown in the spaces summary.
      
      This change is made per MSC3173 allowing stripped state of a room to
      be shown to any potential room joiner.
      2d16e69b
    • Jonathan de Jong's avatar
      [pyupgrade] `tests/` (#10347) · 89cfc3dd
      Jonathan de Jong authored
      89cfc3dd
  21. Jul 12, 2021
  22. Jul 08, 2021
  23. Jul 06, 2021
  24. Jul 01, 2021
  25. Jun 29, 2021
  26. Jun 24, 2021
Loading