Skip to content
Snippets Groups Projects
  1. Sep 24, 2021
    • David Robertson's avatar
      Update postgresql testing script (#10906) · ea01d4c2
      David Robertson authored
      
      - Use sytest:bionic. Sytest:latest is two years old (do we want
        CI to push out latest at all?) and comes with Python 3.5, which we
        explictly no longer support. The script now runs under PostgreSQL 10
        as a result.
      - Advertise script in the docs
      - Move pg testing script to scripts-dev directory
      - Write to host as the script's exector, not root
      
      A few changes to make it speedier to re-run the tests:
      
      - Create blank DB in the container, not the script, so we don't have to
        `initdb` each time
      - Use a named volume to persist the tox environment, so we don't have to
        fetch and install a bunch of packages from PyPI each time
      
      Co-authored-by: default avatarreivilibre <olivier@librepush.net>
      ea01d4c2
    • Richard van der Hoff's avatar
    • 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
    • Richard van der Hoff's avatar
      Simplify `_auth_and_persist_fetched_events` (#10901) · 261c9763
      Richard van der Hoff authored
      Combine the two loops over the list of events, and hence get rid of
      `_NewEventInfo`. Also pass the event back alongside the context, so that it's
      easier to process the result.
      261c9763
    • Erik Johnston's avatar
    • Jason Robinson's avatar
      Fix AuthBlocking check when requester is appservice (#10881) · fa745363
      Jason Robinson authored
      
      If the MAU count had been reached, Synapse incorrectly blocked appservice users even though they've been explicitly configured not to be tracked (the default). This was due to bypassing the relevant if as it was chained behind another earlier hit if as an elif.
      
      Signed-off-by: default avatarJason Robinson <jasonr@matrix.org>
      fa745363
    • 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
    • Kokokokoka's avatar
      In `_purge_history_txn`, ensure that txn.fetchall has elements before accessing rows (#10690) · e704cc2a
      Kokokokoka authored
      
      This change adds a check for row existence before accessing row element, this should fix issue #10669
      Signed-off-by: default avatarVasya Boytsov <vasiliy.boytsov@phystech.edu>
      e704cc2a
  2. Sep 23, 2021
  3. Sep 22, 2021
  4. Sep 21, 2021
Loading