1
0
Fork 0
mirror of https://github.com/element-hq/synapse.git synced 2026-07-27 16:12:45 +02:00
Synapse: Matrix homeserver written in Python/Twisted.
  • Python 95.5%
  • Rust 3%
  • HTML 0.4%
  • Shell 0.4%
  • Go 0.2%
  • Other 0.2%
Find a file
Erik Johnston 51672809c7
Fix _get_server_keys_json invalidations over replication as JSON (#19966)
The cache key of `_get_server_keys_json` is a single argument which is
itself a `(server_name, key_id)` tuple, and `store_server_keys_response`
passed that nested tuple straight into the cache invalidation stream.
psycopg2 quietly serialises the inner tuple as a Postgres *record*, so
the `keys` column of `cache_invalidation_stream_by_instance` ended up
holding the record literal as a single string (e.g.
`{"(srv,ed25519:abc)"}`) — which never matches the real cache key on the
receiving side, i.e. the
invalidation has always been a silent no-op on workers. The native Rust
backend's stricter parameter conversion turns the same nested tuple into
a loud `TypeError: unsupported parameter type for postgres: tuple`.

Fix it the same way https://github.com/element-hq/synapse/pull/18899 did
for `_get_e2e_cross_signing_signatures_for_device`, which has the same
nested-tuple key shape: invalidate the local cache directly, JSON-encode
the key for the replication row, and decode it again in
`process_replication_rows`.

Found as part of the the effort to port the database pool to Rust.
2026-07-27 09:29:58 +01:00
.ci Hide successful, skipped Complement tests in the CI (#19590) 2026-03-23 15:16:23 +00:00
.github Bump the minor-and-patches group with 5 updates (#19982) 2026-07-24 09:23:18 +00:00
changelog.d Fix _get_server_keys_json invalidations over replication as JSON (#19966) 2026-07-27 09:29:58 +01:00
complement Bump golang.org/x/crypto from 0.51.0 to 0.52.0 in /complement (#19925) 2026-07-14 09:04:15 +00:00
contrib MSC4242: State DAGs (CSAPI) (#19424) 2026-04-16 15:46:47 +00:00
debian 1.157.1 2026-07-22 09:31:47 -05:00
demo Fix small comment typo in config output from the demo/start.sh script (#19538) 2026-03-30 11:14:25 -05:00
docker Fix Complement test flake when restarting Synapse workers (cross-test pollution caused by nginx upstreams being temporarily unavailable) (#19936) 2026-07-09 11:12:28 -05:00
docs Return M_USER_LIMIT_EXCEEDED error code for media upload limits from MSC4335 (#18876) 2026-07-24 16:39:04 -05:00
rust Support MSC4446: allow moving fully read markers backwards (#19663) 2026-07-13 16:12:26 +00:00
schema Return M_USER_LIMIT_EXCEEDED error code for media upload limits from MSC4335 (#18876) 2026-07-24 16:39:04 -05:00
scripts-dev Update release script JSON schema find/replace to be compatible with macOS (#19962) 2026-07-15 12:01:09 -05:00
stubs Write union types as X | Y where possible (#19111) 2025-11-06 14:02:33 -06:00
synapse Fix _get_server_keys_json invalidations over replication as JSON (#19966) 2026-07-27 09:29:58 +01:00
synmark Port Clock functions to use Duration class (#19229) 2025-12-01 13:55:06 +00:00
tests Fix _get_server_keys_json invalidations over replication as JSON (#19966) 2026-07-27 09:29:58 +01:00
.codecov.yml
.coveragerc
.dockerignore
.editorconfig Apply correct editorconfig to .pyi files (#14526) 2022-11-22 18:33:28 +00:00
.git-blame-ignore-revs Ignore Python language refactors (.git-blame-ignore-revs) (#19150) 2025-11-10 22:34:30 +00:00
.gitignore add before and after filter to redact user method (/_synapse/admin/v1/user/$user_id/redact) (#19802) 2026-07-01 17:28:22 +01:00
.rustfmt.toml Prevent dirty Cargo.lock changes from install (#18693) 2025-07-18 10:28:10 -05:00
AUTHORS.rst
book.toml Bump mdbook from 0.4.17 -> 0.5.2 and remove custom table-of-contents plugin (#19356) 2026-01-07 18:46:03 +00:00
build_rust.py Drop Python 3.9, bump tests/builds to Python 3.10 (#19099) 2025-10-29 12:15:00 -05:00
Cargo.lock Bump anyhow from 1.0.102 to 1.0.103 in the patches group (#19952) 2026-07-15 11:25:46 +00:00
Cargo.toml Fix building rust with nightly (#15906) 2023-07-10 16:24:04 +01:00
CHANGES.md 1.157.1 2026-07-22 09:31:47 -05:00
CONTRIBUTING.md Update the contributing guide after reliecensing (#16772) 2024-01-03 11:31:03 +00:00
flake.lock Fix nix flake 2024-11-20 15:01:56 +00:00
flake.nix Replace PyICU with Rust icu_segmenter crate (#18553) 2025-07-03 11:12:12 +01:00
INSTALL.md Update book location 2023-12-13 16:15:22 +00:00
LICENSE-AGPL-3.0 make dual licensing explicit (#18134) 2025-02-05 13:40:10 +00:00
LICENSE-COMMERCIAL make dual licensing explicit (#18134) 2025-02-05 13:40:10 +00:00
mypy.ini Migrate dev dependencies to PEP 735 dependency groups (#19490) 2026-03-17 14:45:28 +00:00
poetry.lock Bump pillow from 12.2.0 to 12.3.0 (#19983) 2026-07-24 09:21:30 +00:00
pyproject.toml 1.157.1 2026-07-22 09:31:47 -05:00
README.rst Update Element logo to be an absolute URL, so it will render on PyPI (#19368) 2026-01-13 12:03:34 +00:00
sytest-blacklist Use full GitHub links instead of bare issue numbers. (#16637) 2023-11-15 08:02:11 -05:00
tox.ini Drop Python 3.9, bump tests/builds to Python 3.10 (#19099) 2025-10-29 12:15:00 -05:00
UPGRADE.rst Update book location 2023-12-13 16:15:22 +00:00

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

.. image:: https://github.com/element-hq/synapse/raw/develop/docs/element_logo_white_bg.svg
   :height: 60px

**Element Synapse - Matrix homeserver implementation**

|support| |development| |documentation| |license| |pypi| |python|

Synapse is an open source `Matrix <https://matrix.org>`__ homeserver
implementation, written and maintained by `Element <https://element.io>`_.
`Matrix <https://github.com/matrix-org>`__ is the open standard for secure and
interoperable real-time communications. You can directly run and manage the
source code in this repository, available under an AGPL license (or
alternatively under a commercial license from Element).

There is no support provided by Element unless you have a subscription from
Element.

🚀 Getting started
==================

This component is developed and maintained by `Element <https://element.io>`_.
It gets shipped as part of the **Element Server Suite (ESS)** which provides the
official means of deployment.

ESS is a Matrix distribution from Element with focus on quality and ease of use.
It ships a full Matrix stack tailored to the respective use case.

There are three editions of ESS:

- `ESS Community <https://github.com/element-hq/ess-helm>`_ - the free Matrix
  distribution from Element tailored to small-/mid-scale, non-commercial
  community use cases
- `ESS Pro <https://element.io/server-suite>`_ - the commercial Matrix
  distribution from Element for professional use
- `ESS TI-M <https://element.io/server-suite/ti-messenger>`_ - a special version
  of ESS Pro focused on the requirements of TI-Messenger Pro and ePA as
  specified by the German National Digital Health Agency Gematik


🛠️ Standalone installation and configuration
============================================

The Synapse documentation describes `options for installing Synapse standalone
<https://element-hq.github.io/synapse/latest/setup/installation.html>`_. See
below for more useful documentation links.

- `Synapse configuration options <https://element-hq.github.io/synapse/latest/usage/configuration/config_documentation.html>`_
- `Synapse configuration for federation <https://element-hq.github.io/synapse/latest/federate.html>`_
- `Using a reverse proxy with Synapse <https://element-hq.github.io/synapse/latest/reverse_proxy.html>`_
- `Upgrading Synapse <https://element-hq.github.io/synapse/develop/upgrade.html>`_


🎯 Troubleshooting and support
==============================

🚀 Professional support
-----------------------

Enterprise quality support for Synapse including SLAs is available as part of an
`Element Server Suite (ESS) <https://element.io/pricing>`_ subscription.

If you are an existing ESS subscriber then you can raise a `support request <https://ems.element.io/support>`_
and access the `Element product documentation <https://docs.element.io>`_.

🤝 Community support
--------------------

The `Admin FAQ <https://element-hq.github.io/synapse/latest/usage/administration/admin_faq.html>`_
includes tips on dealing with some common problems. For more details, see
`Synapse's wider documentation <https://element-hq.github.io/synapse/latest/>`_.

For additional support installing or managing Synapse, please ask in the community
support room |room|_ (from a matrix.org account if necessary). We do not use GitHub
issues for support requests, only for bug reports and feature requests.

.. |room| replace:: ``#synapse:matrix.org``
.. _room: https://matrix.to/#/#synapse:matrix.org

.. |docs| replace:: ``docs``
.. _docs: docs


🛠️ Development
==============

We welcome contributions to Synapse from the community!
The best place to get started is our
`guide for contributors <https://element-hq.github.io/synapse/latest/development/contributing_guide.html>`_.
This is part of our broader `documentation <https://element-hq.github.io/synapse/latest>`_, which includes
information for Synapse developers as well as Synapse administrators.

Developers might be particularly interested in:

* `Synapse's database schema <https://element-hq.github.io/synapse/latest/development/database_schema.html>`_,
* `notes on Synapse's implementation details <https://element-hq.github.io/synapse/latest/development/internal_documentation/index.html>`_, and
* `how we use git <https://element-hq.github.io/synapse/latest/development/git.html>`_.

Alongside all that, join our developer community on Matrix:
`#synapse-dev:matrix.org <https://matrix.to/#/#synapse-dev:matrix.org>`_, featuring real humans!

Copyright and Licensing
=======================

  | Copyright 20142017 OpenMarket Ltd
  | Copyright 2017 Vector Creations Ltd
  | Copyright 20172025 New Vector Ltd
  | Copyright 2025 Element Creations Ltd

This software is dual-licensed by Element Creations Ltd (Element). It can be
used either:

(1) for free under the terms of the GNU Affero General Public License (as
    published by the Free Software Foundation, either version 3 of the License,
    or (at your option) any later version); OR

(2) under the terms of a paid-for Element Commercial License agreement between
    you and Element (the terms of which may vary depending on what you and
    Element have agreed to).

Unless required by applicable law or agreed to in writing, software distributed
under the Licenses is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied. See the Licenses for the
specific language governing permissions and limitations under the Licenses.

Please contact `licensing@element.io <mailto:licensing@element.io>`_ to purchase
an Element commercial license for this software.


.. |support| image:: https://img.shields.io/badge/matrix-community%20support-success
  :alt: (get community support in #synapse:matrix.org)
  :target: https://matrix.to/#/#synapse:matrix.org

.. |development| image:: https://img.shields.io/matrix/synapse-dev:matrix.org?label=development&logo=matrix
  :alt: (discuss development on #synapse-dev:matrix.org)
  :target: https://matrix.to/#/#synapse-dev:matrix.org

.. |documentation| image:: https://img.shields.io/badge/documentation-%E2%9C%93-success
  :alt: (Rendered documentation on GitHub Pages)
  :target: https://element-hq.github.io/synapse/latest/

.. |license| image:: https://img.shields.io/github/license/element-hq/synapse
  :alt: (check license in LICENSE file)
  :target: LICENSE

.. |pypi| image:: https://img.shields.io/pypi/v/matrix-synapse
  :alt: (latest version released on PyPi)
  :target: https://pypi.org/project/matrix-synapse

.. |python| image:: https://img.shields.io/pypi/pyversions/matrix-synapse
  :alt: (supported python versions)
  :target: https://pypi.org/project/matrix-synapse