mirror of
https://github.com/element-hq/synapse.git
synced 2026-11-12 20:48:30 +00:00
aecc892ea3691f441b0a7bdfc08c1a0b6c7c96ad
The fifth commit of phase 2. The Rust transaction now runs the rest of `_persist_events_txn`, but for the event cache prefill (`_add_to_cache`) and the profile updates, which stay in Python. - `txn/sticky.rs`: `insert_sticky_events_txn` for the chunk's new events, and `un_soft_fail_sticky_events_txn` for the events `compute_sticky_events_to_un_soft_fail` found in prepare. A de-outliered sticky event becomes sticky inside `update_outliers`, as in Python, so the chunk's redactions come after it. As in Python, an event with a zero sticky duration is not tried there. - `txn/sliding_sync.rs`: the latest stream ordering and bump stamp of the room's `sliding_sync_joined_rooms` row. - `txn/streams.rs`: what was `CacheStream`, now `TxnStream` for any stream the transaction takes IDs from, several at a time. The sticky events stream is the second. Its IDs come back unfinished in `PersistEffects.sticky_stream_ids`. Python finishes them once the caches are invalidated, notifies replication and, as the stream has writers, updates `stream_positions`, as `get_next_mult_txn`'s callbacks do. A failed attempt's IDs are finished as for the cache stream. `persist_events_txn` returns the events left. The test entry no longer returns the de-outliered events. Python's `un_soft_fail_sticky_events_txn` gave the events their new stream IDs in a set's order. It now keeps their order in the stream, by `event_stream_ordering`, with any event without a row last, by event ID. Rust does the same, which lets the twin test compare several events lifted at once. The new scenarios found a Python bug, which Rust keeps. A de-outliered sticky event's `sticky_events` row has the stream ordering of the chunk that de-outliered it, but its `events` row keeps the one it was first persisted with. `delete_sticky_events_txn` looks for the latter, so a redaction of the event, in that chunk or any later one, leaves it sticky until it expires. The twin harness: - records the stream IDs the applier finishes and the notifiers it calls, rather than modelling them from the effects - merges each persist's finished IDs per stream into one call, and compares its notifiers by whether they were called. Python queues them per allocation of IDs, and the effects do each once. - names a background process by what it runs: an ID generator's `stream_positions` update by its stream, any other by its description New twin scenarios: - sticky events in one chunk, one of them expired - a sticky outlier, de-outliered; de-outliered and redacted in one chunk; de-outliered with a new sticky event in one chunk - soft-failed sticky events lifted when their sender joins, one and three at once - a rejected sticky event, a backfilled one, and one redacted in its own chunk A prereqs test checks that applying the effects finishes the sticky events stream IDs after the event cache invalidations, then notifies, and updates `stream_positions`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LXMkcZVkcZhi21augBff4a
add before and after filter to redact user method (/_synapse/admin/v1/user/$user_id/redact) (#19802)
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://customer.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 2014–2017 OpenMarket Ltd | Copyright 2017 Vector Creations Ltd | Copyright 2017–2025 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
Languages
Python
95.2%
Rust
3.5%
HTML
0.4%
Shell
0.3%
Go
0.2%
Other
0.1%