Skip to content
Snippets Groups Projects
  1. Mar 07, 2023
  2. Mar 06, 2023
  3. Mar 03, 2023
  4. Mar 02, 2023
  5. Feb 28, 2023
    • Richard van der Hoff's avatar
      Remove support for aggregating reactions (#15172) · 2b789817
      Richard van der Hoff authored
      It turns out that no clients rely on server-side aggregation of `m.annotation`
      relationships: it's just not very useful as currently implemented.
      
      It's also non-trivial to calculate.
      
      I want to remove it from MSC2677, so to keep the implementation in line, let's
      remove it here.
      Unverified
      2b789817
    • reivilibre's avatar
      Fix a long-standing bug where an initial sync would not respond to changes to... · d62cd940
      reivilibre authored
      Fix a long-standing bug where an initial sync would not respond to changes to the list of ignored users if there was an initial sync cached. (#15163)
      
      Unverified
      d62cd940
    • Patrick Cloke's avatar
      Do not accept pattern_type from user input in push rules. (#15088) · e746f80b
      Patrick Cloke authored
      Internally the push rules module uses a `pattern_type` property for `event_match`
      conditions (and `related_event_match`) to mark the condition as matching the
      current user's Matrix ID or localpart.
      
      This is leaky to the Client-Server API where a user can successfully set a condition
      which provides `pattern_type` instead of `pattern` (note that there's no benefit to
      doing this -- the user can just use their own Matrix ID or localpart instead). When
      serializing back to the client the `pattern_type` property is converted into a proper
      `pattern`.
      
      The following changes are made to avoid this:
      
      * Separate the `KnownCondition::EventMatch` enum value into `EventMatch`
        and `EventMatchType`, each with their own expected properties. (Note that a
        similar change is made for `RelatedEventMatch`.)
      * Make it such that the `pattern_type` variants serialize to the same condition kind,
        but cannot be deserialized (since they're only provided by base rules).
      * As a final tweak, convert `user_id` vs. `user_localpart` values into an enum.
      Unverified
      e746f80b
    • Dirk Klimpel's avatar
      Admin API endpoint to delete a reported event (#15116) · 93f7955e
      Dirk Klimpel authored
      
      * Admin api to delete event report
      
      * lint +  tests
      
      * newsfile
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarDavid Robertson <david.m.robertson1@gmail.com>
      
      * revert changes - move to WorkerStore
      
      * update unit test
      
      * Note that timestamp is in millseconds
      
      ---------
      
      Co-authored-by: default avatarDavid Robertson <david.m.robertson1@gmail.com>
      Unverified
      93f7955e
  6. Feb 27, 2023
  7. Feb 24, 2023
  8. Feb 23, 2023
  9. Feb 22, 2023
  10. Feb 20, 2023
  11. Feb 17, 2023
  12. Feb 16, 2023
    • David Robertson's avatar
      Use mypy 1.0 (#15052) · ffc2ee52
      David Robertson authored
      * Update mypy and mypy-zope
      * Remove unused ignores
      
      These used to suppress
      
      ```
      synapse/storage/engines/__init__.py:28: error: "__new__" must return a
      class instance (got "NoReturn")  [misc]
      ```
      
      and
      
      ```
      synapse/http/matrixfederationclient.py:1270: error: "BaseException" has no attribute "reasons"  [attr-defined]
      ```
      
      (note that we check `hasattr(e, "reasons")` above)
      
      * Avoid empty body warnings, sometimes by marking methods as abstract
      
      E.g.
      
      ```
      tests/handlers/test_register.py:58: error: Missing return statement  [empty-body]
      tests/handlers/test_register.py:108: error: Missing return statement  [empty-body]
      ```
      
      * Suppress false positive about `JaegerConfig`
      
      Complaint was
      
      ```
      synapse/logging/opentracing.py:450: error: Function "Type[Config]" could always be true in boolean context  [truthy-function]
      ```
      
      * Fix not calling `is_state()`
      
      Oops!
      
      ```
      tests/rest/client/test_third_party_rules.py:428: error: Function "Callable[[], bool]" could always be true in boolean context  [truthy-function]
      ```
      
      * Suppress false positives from ParamSpecs
      
      ````
      synapse/logging/opentracing.py:971: error: Argument 2 to "_custom_sync_async_decorator" has incompatible type "Callable[[Arg(Callable[P, R], 'func'), **P], _GeneratorContextManager[None]]"; expected "Callable[[Callable[P, R], **P], _GeneratorContextManager[None]]"  [arg-type]
      synapse/logging/opentracing.py:1017: error: Argument 2 to "_custom_sync_async_decorator" has incompatible type "Callable[[Arg(Callable[P, R], 'func'), **P], _GeneratorContextManager[None]]"; expected "Callable[[Callable[P, R], **P], _GeneratorContextManager[None]]"  [arg-type]
      ````
      
      * Drive-by improvement to `wrapping_logic` annotation
      
      * Workaround false "unreachable" positives
      
      See https://github.com/Shoobx/mypy-zope/issues/91
      
      ```
      tests/http/test_proxyagent.py:626: error: Statement is unreachable  [unreachable]
      tests/http/test_proxyagent.py:762: error: Statement is unreachable  [unreachable]
      tests/http/test_proxyagent.py:826: error: Statement is unreachable  [unreachable]
      tests/http/test_proxyagent.py:838: error: Statement is unreachable  [unreachable]
      tests/http/test_proxyagent.py:845: error: Statement is unreachable  [unreachable]
      tests/http/federation/test_matrix_federation_agent.py:151: error: Statement is unreachable  [unreachable]
      tests/http/federation/test_matrix_federation_agent.py:452: error: Statement is unreachable  [unreachable]
      tests/logging/test_remote_handler.py:60: error: Statement is unreachable  [unreachable]
      tests/logging/test_remote_handler.py:93: error: Statement is unreachable  [unreachable]
      tests/logging/test_remote_handler.py:127: error: Statement is unreachable  [unreachable]
      tests/logging/test_remote_handler.py:152: error: Statement is unreachable  [unreachable]
      ```
      
      * Changelog
      
      * Tweak DBAPI2 Protocol to be accepted by mypy 1.0
      
      Some extra context in:
      - https://github.com/matrix-org/python-canonicaljson/pull/57
      - https://github.com/python/mypy/issues/6002
      - https://mypy.readthedocs.io/en/latest/common_issues.html#covariant-subtyping-of-mutable-protocol-members-is-rejected
      
      * Pull in updated canonicaljson lib
      
      so the protocol check just works
      
      * Improve comments in opentracing
      
      I tried to workaround the ignores but found it too much trouble.
      
      I think the corresponding issue is
      https://github.com/python/mypy/issues/12909. The mypy repo has a PR
      claiming to fix this (https://github.com/python/mypy/pull/14677) which
      might mean this gets resolved soon?
      
      * Better annotation for INTERACTIVE_AUTH_CHECKERS
      
      * Drive-by AUTH_TYPE annotation, to remove an ignore
      Unverified
      ffc2ee52
    • Patrick Cloke's avatar
      Update intentional mentions (MSC3952) to depend on `exact_event_match` (MSC3758). (#15037) · 979f237b
      Patrick Cloke authored
      This replaces the specific `is_room_mention` push rule condition
      used in MSC3952 with the generic `exact_event_match` push rule
      condition from MSC3758.
      
      No functionality changes due to this.
      Unverified
      979f237b
  13. Feb 14, 2023
  14. Feb 10, 2023
  15. Feb 09, 2023
    • Shay's avatar
      Add a class UnpersistedEventContext to allow for the batching up of storing state groups (#14675) · 03bccd54
      Shay authored
      
      * add class UnpersistedEventContext
      
      * modify create new client event to create unpersistedeventcontexts
      
      * persist event contexts after creation
      
      * fix tests to persist unpersisted event contexts
      
      * cleanup
      
      * misc lints + cleanup
      
      * changelog + fix comments
      
      * lints
      
      * fix batch insertion?
      
      * reduce redundant calculation
      
      * add unpersisted event classes
      
      * rework compute_event_context, split into function that returns unpersisted event context and then persists it
      
      * use calculate_context_info to create unpersisted event contexts
      
      * update typing
      
      * $%#^&*
      
      * black
      
      * fix comments and consolidate classes, use attr.s for class
      
      * requested changes
      
      * lint
      
      * requested changes
      
      * requested changes
      
      * refactor to be stupidly explicit
      
      * clearer renaming and flow
      
      * make partial state non-optional
      
      * update docstrings
      
      ---------
      
      Co-authored-by: default avatarErik Johnston <erik@matrix.org>
      Unverified
      03bccd54
    • Patrick Cloke's avatar
      Respond correctly to unknown methods on known endpoints (#14605) · d22c1c86
      Patrick Cloke authored
      Respond with a 405 error if a request is received on a known endpoint,
      but to an unknown method, per MSC3743.
      Unverified
      d22c1c86
    • David Robertson's avatar
      Proper types for `tests.module_api` (#15031) · 7081bb56
      David Robertson authored
      * -> None for test methods
      
      * A first batch of type fixes
      
      * Introduce common parent test case
      
      * Fixup that big test method
      
      * tests.module_api passes mypy
      
      * Changelog
      Unverified
      7081bb56
  16. Feb 08, 2023
  17. Feb 07, 2023
Loading