Skip to content
Snippets Groups Projects
  1. Sep 30, 2021
  2. Sep 29, 2021
  3. Sep 28, 2021
    • Erik Johnston's avatar
      Add #10932 to release · 62800a8f
      Erik Johnston authored
      62800a8f
    • Hillery Shay's avatar
      Update utility code to handle C implementations of frozendict (#10902) · 0f007fe0
      Hillery Shay authored
      * update _handle_frozendict to work with c implementations of frozen dict
      
      * add changelog
      
      * add clarifying comment to _handle_frozendict
      0f007fe0
    • Richard van der Hoff's avatar
      Drop backwards-compatibility support for "outlier" (#10903) · 8aaa4b7b
      Richard van der Hoff authored
      Before Synapse 1.31 (#9411), we relied on `outlier` being stored in the
      `internal_metadata` column. We can now assume nobody will roll back their
      deployment that far and drop the legacy support.
      8aaa4b7b
    • Richard van der Hoff's avatar
      Inline `_check_event_auth` for outliers (#10926) · 2622b28c
      Richard van der Hoff authored
      * Inline `_check_event_auth` for outliers
      
      When we are persisting an outlier, most of `_check_event_auth` is redundant:
      
       * `_update_auth_events_and_context_for_auth` does nothing, because the
         `input_auth_events` are (now) exactly the event's auth_events,
         which means that `missing_auth` is empty.
      
       * we don't care about soft-fail, kicking guest users or `send_on_behalf_of`
         for outliers
      
      ... so the only thing that matters is the auth itself, so let's just do that.
      
      * `_auth_and_persist_fetched_events_inner`: de-async `prep`
      
      `prep` no longer calls any `async` methods, so let's make it synchronous.
      
      * Simplify `_check_event_auth`
      
      We no longer need to support outliers here, which makes things rather simpler.
      
      * changelog
      
      * lint
      2622b28c
    • Erik Johnston's avatar
      Fix exception responding to request that has been closed (#10932) · 37bb93d1
      Erik Johnston authored
      Introduced in #10905
      37bb93d1
    • Patrick Cloke's avatar
      Clean-up type hints in server config (#10915) · eb2c7e51
      Patrick Cloke authored
      By using attrs instead of dicts to store configuration.
      
      Also updates some of the attrs classes to use proper type
      hints and auto_attribs.
      eb2c7e51
    • Erik Johnston's avatar
      Fixup changelog · 2b9d1747
      Erik Johnston authored
      2b9d1747
    • Erik Johnston's avatar
      Fixup changelog · bc69d493
      Erik Johnston authored
      bc69d493
    • Patrick Cloke's avatar
      Only do restricted join rules signature checks for room versions 8/9. (#10927) · c3ccad77
      Patrick Cloke authored
      Otherwise the presence of a (bogus, unused) field could cause
      auth checks to fail.
      c3ccad77
    • Erik Johnston's avatar
      1.44.0rc1 · 3c50192d
      Erik Johnston authored
      3c50192d
    • Erik Johnston's avatar
      Fix debian package builds. (#10931) · a8bbf085
      Erik Johnston authored
      This was due to dh-virtualenv builds being broken due to Shpinx removing
      deprecated APIs.
      a8bbf085
    • Erik Johnston's avatar
      Encode JSON responses on a thread in C, mk2 (#10905) · 707d5e4e
      Erik Johnston authored
      Currently we use `JsonEncoder.iterencode` to write JSON responses, which ensures that we don't block the main reactor thread when encoding huge objects. The downside to this is that `iterencode` falls back to using a pure Python encoder that is *much* less efficient and can easily burn a lot of CPU for huge responses. To fix this, while still ensuring we don't block the reactor loop, we encode the JSON on a threadpool using the standard `JsonEncoder.encode` functions, which is backed by a C library.
      
      Doing so, however, requires `respond_with_json` to have access to the reactor, which it previously didn't. There are two ways of doing this:
      
      1. threading through the reactor object, which is a bit fiddly as e.g. `DirectServeJsonResource` doesn't currently take a reactor, but is exposed to modules and so is a PITA to change; or
      2. expose the reactor in `SynapseRequest`, which requires updating a bunch of servlet types.
      
      I went with the latter as that is just a mechanical change, and I think makes sense as a request already has a reactor associated with it (via its http channel). 
      707d5e4e
  4. Sep 27, 2021
  5. Sep 24, 2021
    • Eric Eastwood's avatar
      Document changes to schema version 61 - 64 (#10917) · d1381870
      Eric Eastwood authored
      As pointed out by @richvdh, https://github.com/matrix-org/synapse/pull/10838#discussion_r715424244
      
      Retroactively summarize `61` - `64`
      d1381870
    • Brendan Abolivier's avatar
      Add a spamchecker callback to allow or deny room creation based on invites (#10898) · b10257e8
      Brendan Abolivier authored
      This is in the context of creating new module callbacks that modules in https://github.com/matrix-org/synapse-dinsic can use, in an effort to reconcile the spam checker API in synapse-dinsic with the one in mainline.
      
      This adds a callback that's fairly similar to user_may_create_room except it also allows processing based on the invites sent at room creation.
      b10257e8
    • 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
Loading