Skip to content
Snippets Groups Projects
  1. Jan 27, 2023
    • Patrick Cloke's avatar
      Implement MSC3952: Intentional mentions (#14823) · 2a51f3ec
      Patrick Cloke authored
      MSC3952 defines push rules which searches for mentions in a list of
      Matrix IDs in the event body, instead of searching the entire event
      body for display name / local part.
      
      This is implemented behind an experimental configuration flag and
      does not yet implement the backwards compatibility pieces of the MSC.
      2a51f3ec
  2. Jan 26, 2023
  3. Jan 25, 2023
  4. Jan 23, 2023
    • David Robertson's avatar
      Faster joins: omit partial rooms from eager syncs until the resync completes (#14870) · 80d44060
      David Robertson authored
      
      * Allow `AbstractSet` in `StrCollection`
      
      Or else frozensets are excluded. This will be useful in an upcoming
      commit where I plan to change a function that accepts `List[str]` to
      accept `StrCollection` instead.
      
      * `rooms_to_exclude` -> `rooms_to_exclude_globally`
      
      I am about to make use of this exclusion mechanism to exclude rooms for
      a specific user and a specific sync. This rename helps to clarify the
      distinction between the global config and the rooms to exclude for a
      specific sync.
      
      * Better function names for internal sync methods
      
      * Track a list of excluded rooms on SyncResultBuilder
      
      I plan to feed a list of partially stated rooms for this sync to ignore
      
      * Exclude partial state rooms during eager sync
      
      using the mechanism established in the previous commit
      
      * Track un-partial-state stream in sync tokens
      
      So that we can work out which rooms have become fully-stated during a
      given sync period.
      
      * Fix mutation of `@cached` return value
      
      This was fouling up a complement test added alongside this PR.
      Excluding a room would mean the set of forgotten rooms in the cache
      would be extended. This means that room could be erroneously considered
      forgotten in the future.
      
      Introduced in #12310, Synapse 1.57.0. I don't think this had any
      user-visible side effects (until now).
      
      * SyncResultBuilder: track rooms to force as newly joined
      
      Similar plan as before. We've omitted rooms from certain sync responses;
      now we establish the mechanism to reintroduce them into future syncs.
      
      * Read new field, to present rooms as newly joined
      
      * Force un-partial-stated rooms to be newly-joined
      
      for eager incremental syncs only, provided they're still fully stated
      
      * Notify user stream listeners to wake up long polling syncs
      
      * Changelog
      
      * Typo fix
      
      Co-authored-by: default avatarSean Quah <8349537+squahtx@users.noreply.github.com>
      
      * Unnecessary list cast
      
      Co-authored-by: default avatarSean Quah <8349537+squahtx@users.noreply.github.com>
      
      * Rephrase comment
      
      Co-authored-by: default avatarSean Quah <8349537+squahtx@users.noreply.github.com>
      
      * Another comment
      
      Co-authored-by: default avatarSean Quah <8349537+squahtx@users.noreply.github.com>
      
      * Fixup merge(?)
      
      * Poke notifier when receiving un-partial-stated msg over replication
      
      * Fixup merge whoops
      
      Thanks MV :)
      
      Co-authored-by: default avatarMathieu Velen <mathieuv@matrix.org>
      
      Co-authored-by: default avatarMathieu Velten <mathieuv@matrix.org>
      Co-authored-by: default avatarSean Quah <8349537+squahtx@users.noreply.github.com>
      80d44060
    • Patrick Cloke's avatar
      Skip processing stats for broken rooms. (#14873) · 82d3efa3
      Patrick Cloke authored
      * Skip processing stats for broken rooms.
      
      * Newsfragment
      
      * Use a custom exception.
      82d3efa3
  5. Jan 22, 2023
  6. Jan 21, 2023
  7. Jan 20, 2023
    • Erik Johnston's avatar
      Always notify replication when a stream advances (#14877) · 65d03866
      Erik Johnston authored
      This ensures that all other workers are told about stream updates in a timely manner, without having to remember to manually poke replication.
      65d03866
    • Sean Quah's avatar
      Faster joins: Avoid starting duplicate partial state syncs (#14844) · cdea7c11
      Sean Quah authored
      
      Currently, we will try to start a new partial state sync every time we
      perform a remote join, which is undesirable if there is already one
      running for a given room.
      
      We intend to perform remote joins whenever additional local users wish
      to join a partial state room, so let's ensure that we do not start more
      than one concurrent partial state sync for any given room.
      
      ------------------------------------------------------------------------
      
      There is a race condition where the homeserver leaves a room and later
      rejoins while the partial state sync from the previous membership is
      still running. There is no guarantee that the previous partial state
      sync will process the latest join, so we restart it if needed.
      
      Signed-off-by: default avatarSean Quah <seanq@matrix.org>
      cdea7c11
  8. Jan 18, 2023
  9. Jan 17, 2023
    • David Robertson's avatar
      Stabilise serving partial join responses (#14839) · 5b3af1c7
      David Robertson authored
      Serving partial join responses is no longer experimental. They will only be served under the stable identifier if the the undocumented config flag experimental.msc3706_enabled is set to true.
      
      Synapse continues to request a partial join only if the undocumented config flag experimental.faster_joins is set to true; this setting remains present and unaffected.
      5b3af1c7
    • Erik Johnston's avatar
      Fix bug in `wait_for_stream_position` (#14856) · 316590d1
      Erik Johnston authored
      We were incorrectly checking if the *local* token had been advanced, rather than the token for the remote instance.
      
      In practice, I don't think this has caused any bugs due to where we use `wait_for_stream_position`, as critically we don't use it on instances that also write to the given streams (and so the local token will lag behind all remote tokens).
      316590d1
  10. Jan 16, 2023
  11. Jan 13, 2023
    • David Robertson's avatar
      Use stable identifiers for faster joins (#14832) · 52ae80dd
      David Robertson authored
      * Use new query param when requesting a partial join
      
      * Read new query param when serving partial join
      
      * Provide new field names when serving partial joins
      
      * Read new field names from partial join response
      
      * Changelog
      52ae80dd
    • Sean Quah's avatar
      Fix stack overflow in `_PerHostRatelimiter` due to synchronous requests (#14812) · 772e8c23
      Sean Quah authored
      
      When there are many synchronous requests waiting on a
      `_PerHostRatelimiter`, each request will be started recursively just
      after the previous request has completed. Under the right conditions,
      this leads to stack exhaustion.
      
      A common way for requests to become synchronous is when the remote
      client disconnects early, because the homeserver is overloaded and slow
      to respond.
      
      Avoid stack exhaustion under these conditions by deferring subsequent
      requests until the next reactor tick.
      
      Fixes #14480.
      
      Signed-off-by: default avatarSean Quah <seanq@matrix.org>
      772e8c23
  12. Jan 12, 2023
  13. Jan 11, 2023
  14. Jan 10, 2023
    • Richard van der Hoff's avatar
      Implement MSC3925: changes to bundling of edits (#14811) · 06ab64f2
      Richard van der Hoff authored
      Two parts to this:
      
       * Bundle the whole of the replacement with any edited events. This is backwards-compatible so I haven't put it behind a flag.
       * Optionally, inhibit server-side replacement of edited events. This has scope to break things, so it is currently disabled by default.
      06ab64f2
  15. Jan 09, 2023
  16. Jan 04, 2023
    • Patrick Cloke's avatar
      Support RFC7636 PKCE in the OAuth 2.0 flow. (#14750) · 630d0aea
      Patrick Cloke authored
      PKCE can protect against certain attacks and is enabled by default. Support
      can be controlled manually by setting the pkce_method of each oidc_providers
      entry to 'auto' (default), 'always', or 'never'.
      
      This is required by Twitter OAuth 2.0 support.
      630d0aea
  17. Dec 28, 2022
  18. Dec 16, 2022
  19. Dec 13, 2022
    • David Robertson's avatar
      Allow selecting "prejoin" events by state keys (#14642) · e2a1adbf
      David Robertson authored
      * Declare new config
      
      * Parse new config
      
      * Read new config
      
      * Don't use trial/our TestCase where it's not needed
      
      Before:
      
      ```
      $ time trial tests/events/test_utils.py > /dev/null
      
      real	0m2.277s
      user	0m2.186s
      sys	0m0.083s
      ```
      
      After:
      ```
      $ time trial tests/events/test_utils.py > /dev/null
      
      real	0m0.566s
      user	0m0.508s
      sys	0m0.056s
      ```
      
      * Helper to upsert to event fields
      
      without exceeding size limits.
      
      * Use helper when adding invite/knock state
      
      Now that we allow admins to include events in prejoin room state with
      arbitrary state keys, be a good Matrix citizen and ensure they don't
      accidentally create an oversized event.
      
      * Changelog
      
      * Move StateFilter tests
      
      should have done this in #14668
      
      * Add extra methods to StateFilter
      
      * Use StateFilter
      
      * Ensure test file enforces typed defs; alphabetise
      
      * Workaround surprising get_current_state_ids
      
      * Whoops, fix mypy
      e2a1adbf
  20. Dec 12, 2022
  21. Dec 09, 2022
  22. Dec 08, 2022
  23. Dec 07, 2022
Loading