Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Make historical events discoverable from backfill for servers without any scrollback history (MSC2716) (federation) #10245

Conversation

MadLittleMods
Copy link
Contributor

@MadLittleMods MadLittleMods commented Jun 24, 2021

Make historical events discoverable from backfill for servers without any scrollback history.

  • This does not cover "marker" events or servers which already have all of the scrollback(no backwards extremeties to pull from)
  • As the /backfill function iterates up the DAG, we also check for any insertion events which have prev_events pointing to the current backfill event. If we find one, we pull in the insertion event and start of the chunk. Then keep iterating up the chunk of history.

Part of MSC2716: matrix-org/matrix-spec-proposals#2716

Follow-up to #9247

Mermaid live editor playground link

mermaid graph syntax
flowchart BT
    subgraph live
        B -----------------> A
    end
    
    subgraph chunk0
        chunk0-chunk[["chunk"]] --> chunk0-2(("2")) --> chunk0-1((1)) --> chunk0-0((0)) --> chunk0-insertion[/insertion\]
    end

    subgraph chunk1
        chunk1-chunk[["chunk"]] --> chunk1-2(("2")) --> chunk1-1((1)) --> chunk1-0((0)) --> chunk1-insertion[/insertion\]
    end
    
    subgraph chunk2
        chunk2-chunk[["chunk"]] --> chunk2-2(("2")) --> chunk2-1((1)) --> chunk2-0((0)) --> chunk2-insertion[/insertion\]
    end

    
    chunk0-insertionBase[/insertion\] -------------> A
    chunk0-chunk -.-> chunk0-insertionBase[/insertion\]
    chunk1-chunk -.-> chunk0-insertion
    chunk2-chunk -.-> chunk1-insertion
Loading

Dev notes


Access database in Complement test Docker container:

$ docker exec -it complement_1_hs_with_application_service.hs1_2 /bin/bash

$ apt-get update && apt-get install -y sqlite3

$ sqlite3
> .open /conf/homeserver.db

  • synapse/storage/schema/__init__.py (synapse.storage.schema.SCHEMA_VERSION and synapse.storage.schema.SCHEMA_COMPAT_VERSION)
  • synapse/storage/prepare_database.py ->_setup_new_database and _upgrade_existing_database

    Sets up the physical database by finding a base set of "full schemas" and
    then applying any necessary deltas, including schemas from the given data
    stores.

    The "full_schemas" directory has subdirectories named after versions. This
    function searches for the highest version less than or equal to
    SCHEMA_VERSION and executes all .sql files in that directory.

  • asdf


Call stacks for backfilling

From the remote server

  • RoomMessageListRestServlet.on_GET
  • get_messages
  • maybe_backfill
  • _maybe_backfill_inner
  • try_backfill
  • backfill

From the origin server

  • FederationBackfillServlet.on_GET
  • on_backfill_request
  • get_backfill_events

get_events
get_events_as_list
_get_events_from_cache_or_db
_get_events_from_db
_enqueue_events
_do_fetch
_fetch_event_list
_fetch_event_rows

Previous federation attempt at changing backfill looking at successors, https://github.com/matrix-org/synapse/pull/9247/files/13b18a8ec5cf03e3f46cc730464cfbfd10c82664#diff-1f5d8bffadd3271e42c2f6a66474bbf5e3e6694b009aa616b5f5433506217ff1R965


go test -v -tags synapse_blacklist,msc2946,msc3083,msc2716,msc2403 -count=1 $EXTRA_COMPLEMENT_ARGS ./tests -run TestBackfillingHistory/parallel/Historical_messages_are_visible_when_joining_on_federated_server

go test -v -tags synapse_blacklist,msc2946,msc3083,msc2716,msc2403 -count=1 $EXTRA_COMPLEMENT_ARGS ./tests -run TestBackfillingHistory/parallel/Historical_messages_are_visible_when_joining_on_federated_server_-_pre-made_insertion_event

Todo

Pull Request Checklist

  • Pull request is based on the develop branch
  • Pull request includes a changelog file. The entry should:
    • Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from EventStore to EventWorkerStore.".
    • Use markdown where necessary, mostly for code blocks.
    • End with either a period (.) or an exclamation mark (!).
    • Start with a capital letter.
  • Pull request includes a sign off
  • Code style is correct (run the linters)

Follow-up to #9247

Part of MSC2716: matrix-org/matrix-spec-proposals#2716

---

Previously, Synapse would throw a 403,
`Cannot force another user to join.`,
because we were trying to use `?user_id` from a single virtual user
which did not match with messages from other users in the chunk.
…ents-for-federation

Conflicts:
	scripts-dev/complement.sh
@erikjohnston erikjohnston marked this pull request as draft July 7, 2021 08:01
@MadLittleMods MadLittleMods force-pushed the madlittlemods/2716-backfill-historical-events-for-federation branch from c29dc64 to f20ba02 Compare July 14, 2021 06:34
@@ -1504,6 +1504,9 @@ def _update_metadata_tables_txn(

self._handle_event_relations(txn, event)

self._handle_insertion_event(txn, event)
self._handle_chunk_id(txn, event)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is the best place to limit who can add an insertion event or a chunk connection content field?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably want to reject such events, so we probably want to add some stuff to the event authorization code.

Copy link
Contributor Author

@MadLittleMods MadLittleMods Jul 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am having trouble fitting this into the existing code.

  • I need to make sure that only application services can send insertion, marker, and events with chunk ID's
  • Other homeservers need to be able to accept these events over federation. But probably should only trust the originating homeserver where the room is. How does originating homeserver even work when future room ID's don't include the homeserver?
    • Maybe it should be some power level and we can specify the application service user ID with a high enough power level?

  • synapse/event_auth.py -> check(...):
    • It feels like the checks should go here next to check_redaction
    • That class doesn't have access to the store so I can't use store.get_app_service_by_user_id(...) to make sure the sender is an application service. Plus this code is probably run for events coming over federation which don't know which sender is an application service.
    • It could fit here if it was a new power level since we have the auth events
  • synapse/handlers/event_auth.py -> check_from_context(...)
    • I can use store.get_app_service_by_user_id(...) but other code is still only protected by the raw check(...)

def _check_if_allowed_to_send_historical_events
    def _check_if_allowed_to_send_historical_events(
        self,
        event: EventBase,
    ):
        """Check whether the event sender is allowed to add insertion, marker,
        or events with a chunk ID

        Raises:
            AuthError if the event sender is not an application service
        """

        if (
            event.type != EventTypes.MSC2716_INSERTION
            and event.type != EventTypes.MSC2716_MARKER
            and event.content.get(EventContentFields.MSC2716_CHUNK_ID) is None
        ):
            pass

        app_service = self._store.get_app_service_by_user_id(event.sender)

        if app_service is None:
            raise AuthError(403, "Only application services can send insertion events")

Copy link
Contributor Author

@MadLittleMods MadLittleMods Jul 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using the m.room.power_levels -> events ("The level required to send specific event types. This is a mapping from event type to power level required.") field seems perfect 🎉

But we would probably want to default the power level for those events in existing rooms which don't have it set yet. Maybe default to only the creator or admins can do it if not explicitly set in power levels. Or keep it simple and not allow the history based events at all unless the power level was set. Is there any precedent for this? There is events_default but it's usually set low to allow any events.

The one problem I see is that there doesn't seem to be precedent for controlling a content field. The content.chunk_id field would also be on normal events from a non-application service user so I don't see a way to differentiate and auth it 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added unstable room version org.matrix.msc2716 which adds the historical power level that controls whether you can send insertion, chunk, and marker events ✅

I switched to chunk events so we can easily auth them against the PL level because they are sent by the application service user ID with the proper PL level for the room. See #10432

@@ -196,9 +196,6 @@ class EventContentFields:
MSC2716_CHUNK_ID = "org.matrix.msc2716.chunk_id"
# For "marker" events
MSC2716_MARKER_INSERTION = "org.matrix.msc2716.marker.insertion"
MSC2716_MARKER_INSERTION_PREV_EVENTS = (
"org.matrix.msc2716.marker.insertion_prev_events"
)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we will use this 🤷

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switched to backfilling the insertion event in #10420

MadLittleMods added a commit to matrix-org/complement that referenced this pull request Jul 26, 2021
…m version (#176)

* Use experimental org.matrix.msc2716 room version for MSC2716 tests

As introduced in matrix-org/synapse#10245,
use experimental `org.matrix.msc2716` room version.

* Use shared createRoomOpts
Copy link
Member

@erikjohnston erikjohnston left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this looks good, modulo adding a get_event_txn function. Have asked in #synapse-dev:matrix.org if its safe to rip the fallback code out

synapse/storage/databases/main/events_worker.py Outdated Show resolved Hide resolved
Copy link
Member

@erikjohnston erikjohnston left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@MadLittleMods MadLittleMods merged commit d0b294a into develop Jul 28, 2021
@MadLittleMods
Copy link
Contributor Author

Woot! Thanks for all of the review @erikjohnston 🐣

@MadLittleMods MadLittleMods added the T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements. label Jul 28, 2021
@MadLittleMods MadLittleMods changed the title Make historical events discoverable from backfill for servers without any scrollback history (MSC2716) Make historical events discoverable from backfill for servers without any scrollback history (MSC2716) (federation) Aug 6, 2021
aaronraimist added a commit to aaronraimist/synapse that referenced this pull request Aug 13, 2021
Synapse 1.40.0 (2021-08-10)
===========================

No significant changes.

Synapse 1.40.0rc3 (2021-08-09)
==============================

Features
--------

- Support [MSC3289: room version 8](matrix-org/matrix-spec-proposals#3289). ([\matrix-org#10449](matrix-org#10449))

Bugfixes
--------

- Mark the experimental room version from [MSC2716](matrix-org/matrix-spec-proposals#2716) as unstable. ([\matrix-org#10449](matrix-org#10449))

Improved Documentation
----------------------

- Fix broken links in `upgrade.md`. Contributed by @dklimpel. ([\matrix-org#10543](matrix-org#10543))

Synapse 1.40.0rc2 (2021-08-04)
==============================

Bugfixes
--------

- Fix the `PeriodicallyFlushingMemoryHandler` inhibiting application shutdown because of its background thread. ([\matrix-org#10517](matrix-org#10517))
- Fix a bug introduced in Synapse v1.40.0rc1 that could cause Synapse to respond with an error when clients would update read receipts. ([\matrix-org#10531](matrix-org#10531))

Internal Changes
----------------

- Fix release script to open the correct URL for the release. ([\matrix-org#10516](matrix-org#10516))

Synapse 1.40.0rc1 (2021-08-03)
==============================

Features
--------

- Add support for [MSC2033](matrix-org/matrix-spec-proposals#2033): `device_id` on `/account/whoami`. ([\matrix-org#9918](matrix-org#9918))
- Update support for [MSC2716 - Incrementally importing history into existing rooms](matrix-org/matrix-spec-proposals#2716). ([\matrix-org#10245](matrix-org#10245), [\matrix-org#10432](matrix-org#10432), [\matrix-org#10463](matrix-org#10463))
- Update support for [MSC3083](matrix-org/matrix-spec-proposals#3083) to consider changes in the MSC around which servers can issue join events. ([\matrix-org#10254](matrix-org#10254), [\matrix-org#10447](matrix-org#10447), [\matrix-org#10489](matrix-org#10489))
- Initial support for [MSC3244](matrix-org/matrix-spec-proposals#3244), Room version capabilities over the /capabilities API. ([\matrix-org#10283](matrix-org#10283))
- Add a buffered logging handler which periodically flushes itself. ([\matrix-org#10407](matrix-org#10407), [\matrix-org#10515](matrix-org#10515))
- Add support for https connections to a proxy server. Contributed by @Bubu and @dklimpel. ([\matrix-org#10411](matrix-org#10411))
- Support for [MSC2285 (hidden read receipts)](matrix-org/matrix-spec-proposals#2285). Contributed by @SimonBrandner. ([\matrix-org#10413](matrix-org#10413))
- Email notifications now state whether an invitation is to a room or a space. ([\matrix-org#10426](matrix-org#10426))
- Allow setting transaction limit for database connections. ([\matrix-org#10440](matrix-org#10440), [\matrix-org#10511](matrix-org#10511))
- Add `creation_ts` to "list users" admin API. ([\matrix-org#10448](matrix-org#10448))

Bugfixes
--------

- Improve character set detection in URL previews by supporting underscores (in addition to hyphens). Contributed by @srividyut. ([\matrix-org#10410](matrix-org#10410))
- Fix events being incorrectly rejected over federation if they reference auth events that the server needed to fetch. ([\matrix-org#10439](matrix-org#10439))
- Fix `synapse_federation_server_oldest_inbound_pdu_in_staging` Prometheus metric to not report a max age of 51 years when the queue is empty. ([\matrix-org#10455](matrix-org#10455))
- Fix a bug which caused an explicit assignment of power-level 0 to a user to be misinterpreted in rare circumstances. ([\matrix-org#10499](matrix-org#10499))

Improved Documentation
----------------------

- Fix hierarchy of providers on the OpenID page. ([\matrix-org#10445](matrix-org#10445))
- Consolidate development documentation to `docs/development/`. ([\matrix-org#10453](matrix-org#10453))
- Add some developer docs to explain room DAG concepts like `outliers`, `state_groups`, `depth`, etc. ([\matrix-org#10464](matrix-org#10464))
- Document how to use Complement while developing a new Synapse feature. ([\matrix-org#10483](matrix-org#10483))

Internal Changes
----------------

- Prune inbound federation queues for a room if they get too large. ([\matrix-org#10390](matrix-org#10390))
- Add type hints to `synapse.federation.transport.client` module. ([\matrix-org#10408](matrix-org#10408))
- Remove shebang line from module files. ([\matrix-org#10415](matrix-org#10415))
- Drop backwards-compatibility code that was required to support Ubuntu Xenial. ([\matrix-org#10429](matrix-org#10429))
- Use a docker image cache for the prerequisites for the debian package build. ([\matrix-org#10431](matrix-org#10431))
- Improve servlet type hints. ([\matrix-org#10437](matrix-org#10437), [\matrix-org#10438](matrix-org#10438))
- Replace usage of `or_ignore` in `simple_insert` with `simple_upsert` usage, to stop spamming postgres logs with spurious ERROR messages. ([\matrix-org#10442](matrix-org#10442))
- Update the `tests-done` Github Actions status. ([\matrix-org#10444](matrix-org#10444), [\matrix-org#10512](matrix-org#10512))
- Update type annotations to work with forthcoming Twisted 21.7.0 release. ([\matrix-org#10446](matrix-org#10446), [\matrix-org#10450](matrix-org#10450))
- Cancel redundant GHA workflows when a new commit is pushed. ([\matrix-org#10451](matrix-org#10451))
- Mitigate media repo XSS attacks on IE11 via the non-standard X-Content-Security-Policy header. ([\matrix-org#10468](matrix-org#10468))
- Additional type hints in the state handler. ([\matrix-org#10482](matrix-org#10482))
- Update syntax used to run complement tests. ([\matrix-org#10488](matrix-org#10488))
- Fix up type annotations to work with Twisted 21.7. ([\matrix-org#10490](matrix-org#10490))
- Improve type annotations for `ObservableDeferred`. ([\matrix-org#10491](matrix-org#10491))
- Extend release script to also tag and create GitHub releases. ([\matrix-org#10496](matrix-org#10496))
- Fix a bug which caused production debian packages to be incorrectly marked as 'prerelease'. ([\matrix-org#10500](matrix-org#10500))
babolivier added a commit to matrix-org/synapse-dinsic that referenced this pull request Sep 1, 2021
Synapse 1.40.0 (2021-08-10)
===========================

No significant changes.

Synapse 1.40.0rc3 (2021-08-09)
==============================

Features
--------

- Support [MSC3289: room version 8](matrix-org/matrix-spec-proposals#3289). ([\#10449](matrix-org/synapse#10449))

Bugfixes
--------

- Mark the experimental room version from [MSC2716](matrix-org/matrix-spec-proposals#2716) as unstable. ([\#10449](matrix-org/synapse#10449))

Improved Documentation
----------------------

- Fix broken links in `upgrade.md`. Contributed by @dklimpel. ([\#10543](matrix-org/synapse#10543))

Synapse 1.40.0rc2 (2021-08-04)
==============================

Bugfixes
--------

- Fix the `PeriodicallyFlushingMemoryHandler` inhibiting application shutdown because of its background thread. ([\#10517](matrix-org/synapse#10517))
- Fix a bug introduced in Synapse v1.40.0rc1 that could cause Synapse to respond with an error when clients would update read receipts. ([\#10531](matrix-org/synapse#10531))

Internal Changes
----------------

- Fix release script to open the correct URL for the release. ([\#10516](matrix-org/synapse#10516))

Synapse 1.40.0rc1 (2021-08-03)
==============================

Features
--------

- Add support for [MSC2033](matrix-org/matrix-spec-proposals#2033): `device_id` on `/account/whoami`. ([\#9918](matrix-org/synapse#9918))
- Update support for [MSC2716 - Incrementally importing history into existing rooms](matrix-org/matrix-spec-proposals#2716). ([\#10245](matrix-org/synapse#10245), [\#10432](matrix-org/synapse#10432), [\#10463](matrix-org/synapse#10463))
- Update support for [MSC3083](matrix-org/matrix-spec-proposals#3083) to consider changes in the MSC around which servers can issue join events. ([\#10254](matrix-org/synapse#10254), [\#10447](matrix-org/synapse#10447), [\#10489](matrix-org/synapse#10489))
- Initial support for [MSC3244](matrix-org/matrix-spec-proposals#3244), Room version capabilities over the /capabilities API. ([\#10283](matrix-org/synapse#10283))
- Add a buffered logging handler which periodically flushes itself. ([\#10407](matrix-org/synapse#10407), [\#10515](matrix-org/synapse#10515))
- Add support for https connections to a proxy server. Contributed by @Bubu and @dklimpel. ([\#10411](matrix-org/synapse#10411))
- Support for [MSC2285 (hidden read receipts)](matrix-org/matrix-spec-proposals#2285). Contributed by @SimonBrandner. ([\#10413](matrix-org/synapse#10413))
- Email notifications now state whether an invitation is to a room or a space. ([\#10426](matrix-org/synapse#10426))
- Allow setting transaction limit for database connections. ([\#10440](matrix-org/synapse#10440), [\#10511](matrix-org/synapse#10511))
- Add `creation_ts` to "list users" admin API. ([\#10448](matrix-org/synapse#10448))

Bugfixes
--------

- Improve character set detection in URL previews by supporting underscores (in addition to hyphens). Contributed by @srividyut. ([\#10410](matrix-org/synapse#10410))
- Fix events being incorrectly rejected over federation if they reference auth events that the server needed to fetch. ([\#10439](matrix-org/synapse#10439))
- Fix `synapse_federation_server_oldest_inbound_pdu_in_staging` Prometheus metric to not report a max age of 51 years when the queue is empty. ([\#10455](matrix-org/synapse#10455))
- Fix a bug which caused an explicit assignment of power-level 0 to a user to be misinterpreted in rare circumstances. ([\#10499](matrix-org/synapse#10499))

Improved Documentation
----------------------

- Fix hierarchy of providers on the OpenID page. ([\#10445](matrix-org/synapse#10445))
- Consolidate development documentation to `docs/development/`. ([\#10453](matrix-org/synapse#10453))
- Add some developer docs to explain room DAG concepts like `outliers`, `state_groups`, `depth`, etc. ([\#10464](matrix-org/synapse#10464))
- Document how to use Complement while developing a new Synapse feature. ([\#10483](matrix-org/synapse#10483))

Internal Changes
----------------

- Prune inbound federation queues for a room if they get too large. ([\#10390](matrix-org/synapse#10390))
- Add type hints to `synapse.federation.transport.client` module. ([\#10408](matrix-org/synapse#10408))
- Remove shebang line from module files. ([\#10415](matrix-org/synapse#10415))
- Drop backwards-compatibility code that was required to support Ubuntu Xenial. ([\#10429](matrix-org/synapse#10429))
- Use a docker image cache for the prerequisites for the debian package build. ([\#10431](matrix-org/synapse#10431))
- Improve servlet type hints. ([\#10437](matrix-org/synapse#10437), [\#10438](matrix-org/synapse#10438))
- Replace usage of `or_ignore` in `simple_insert` with `simple_upsert` usage, to stop spamming postgres logs with spurious ERROR messages. ([\#10442](matrix-org/synapse#10442))
- Update the `tests-done` Github Actions status. ([\#10444](matrix-org/synapse#10444), [\#10512](matrix-org/synapse#10512))
- Update type annotations to work with forthcoming Twisted 21.7.0 release. ([\#10446](matrix-org/synapse#10446), [\#10450](matrix-org/synapse#10450))
- Cancel redundant GHA workflows when a new commit is pushed. ([\#10451](matrix-org/synapse#10451))
- Mitigate media repo XSS attacks on IE11 via the non-standard X-Content-Security-Policy header. ([\#10468](matrix-org/synapse#10468))
- Additional type hints in the state handler. ([\#10482](matrix-org/synapse#10482))
- Update syntax used to run complement tests. ([\#10488](matrix-org/synapse#10488))
- Fix up type annotations to work with Twisted 21.7. ([\#10490](matrix-org/synapse#10490))
- Improve type annotations for `ObservableDeferred`. ([\#10491](matrix-org/synapse#10491))
- Extend release script to also tag and create GitHub releases. ([\#10496](matrix-org/synapse#10496))
- Fix a bug which caused production debian packages to be incorrectly marked as 'prerelease'. ([\#10500](matrix-org/synapse#10500))
@MadLittleMods MadLittleMods deleted the madlittlemods/2716-backfill-historical-events-for-federation branch September 7, 2021 20:39
MadLittleMods added a commit to matrix-org/complement that referenced this pull request Sep 8, 2021
 - Update and uncomment MSC2716 federation test cases
    - matrix-org/synapse#10498
    - matrix-org/synapse#10245
 - Simplify `batchSendHistoricalMessages` function signature by using sorta composable functions
 - More proper waiting to avoid flakey test
 - Make error comment match helper function name
 - Add test for private room backfilling
 - Verify we only return state events that we pass in, matrix-org/synapse#10552
Fizzadar pushed a commit to Fizzadar/synapse that referenced this pull request Oct 26, 2021
Synapse 1.40.0 (2021-08-10)
===========================

No significant changes.

Synapse 1.40.0rc3 (2021-08-09)
==============================

Features
--------

- Support [MSC3289: room version 8](matrix-org/matrix-spec-proposals#3289). ([\matrix-org#10449](matrix-org#10449))

Bugfixes
--------

- Mark the experimental room version from [MSC2716](matrix-org/matrix-spec-proposals#2716) as unstable. ([\matrix-org#10449](matrix-org#10449))

Improved Documentation
----------------------

- Fix broken links in `upgrade.md`. Contributed by @dklimpel. ([\matrix-org#10543](matrix-org#10543))

Synapse 1.40.0rc2 (2021-08-04)
==============================

Bugfixes
--------

- Fix the `PeriodicallyFlushingMemoryHandler` inhibiting application shutdown because of its background thread. ([\matrix-org#10517](matrix-org#10517))
- Fix a bug introduced in Synapse v1.40.0rc1 that could cause Synapse to respond with an error when clients would update read receipts. ([\matrix-org#10531](matrix-org#10531))

Internal Changes
----------------

- Fix release script to open the correct URL for the release. ([\matrix-org#10516](matrix-org#10516))

Synapse 1.40.0rc1 (2021-08-03)
==============================

Features
--------

- Add support for [MSC2033](matrix-org/matrix-spec-proposals#2033): `device_id` on `/account/whoami`. ([\matrix-org#9918](matrix-org#9918))
- Update support for [MSC2716 - Incrementally importing history into existing rooms](matrix-org/matrix-spec-proposals#2716). ([\matrix-org#10245](matrix-org#10245), [\matrix-org#10432](matrix-org#10432), [\matrix-org#10463](matrix-org#10463))
- Update support for [MSC3083](matrix-org/matrix-spec-proposals#3083) to consider changes in the MSC around which servers can issue join events. ([\matrix-org#10254](matrix-org#10254), [\matrix-org#10447](matrix-org#10447), [\matrix-org#10489](matrix-org#10489))
- Initial support for [MSC3244](matrix-org/matrix-spec-proposals#3244), Room version capabilities over the /capabilities API. ([\matrix-org#10283](matrix-org#10283))
- Add a buffered logging handler which periodically flushes itself. ([\matrix-org#10407](matrix-org#10407), [\matrix-org#10515](matrix-org#10515))
- Add support for https connections to a proxy server. Contributed by @Bubu and @dklimpel. ([\matrix-org#10411](matrix-org#10411))
- Support for [MSC2285 (hidden read receipts)](matrix-org/matrix-spec-proposals#2285). Contributed by @SimonBrandner. ([\matrix-org#10413](matrix-org#10413))
- Email notifications now state whether an invitation is to a room or a space. ([\matrix-org#10426](matrix-org#10426))
- Allow setting transaction limit for database connections. ([\matrix-org#10440](matrix-org#10440), [\matrix-org#10511](matrix-org#10511))
- Add `creation_ts` to "list users" admin API. ([\matrix-org#10448](matrix-org#10448))

Bugfixes
--------

- Improve character set detection in URL previews by supporting underscores (in addition to hyphens). Contributed by @srividyut. ([\matrix-org#10410](matrix-org#10410))
- Fix events being incorrectly rejected over federation if they reference auth events that the server needed to fetch. ([\matrix-org#10439](matrix-org#10439))
- Fix `synapse_federation_server_oldest_inbound_pdu_in_staging` Prometheus metric to not report a max age of 51 years when the queue is empty. ([\matrix-org#10455](matrix-org#10455))
- Fix a bug which caused an explicit assignment of power-level 0 to a user to be misinterpreted in rare circumstances. ([\matrix-org#10499](matrix-org#10499))

Improved Documentation
----------------------

- Fix hierarchy of providers on the OpenID page. ([\matrix-org#10445](matrix-org#10445))
- Consolidate development documentation to `docs/development/`. ([\matrix-org#10453](matrix-org#10453))
- Add some developer docs to explain room DAG concepts like `outliers`, `state_groups`, `depth`, etc. ([\matrix-org#10464](matrix-org#10464))
- Document how to use Complement while developing a new Synapse feature. ([\matrix-org#10483](matrix-org#10483))

Internal Changes
----------------

- Prune inbound federation queues for a room if they get too large. ([\matrix-org#10390](matrix-org#10390))
- Add type hints to `synapse.federation.transport.client` module. ([\matrix-org#10408](matrix-org#10408))
- Remove shebang line from module files. ([\matrix-org#10415](matrix-org#10415))
- Drop backwards-compatibility code that was required to support Ubuntu Xenial. ([\matrix-org#10429](matrix-org#10429))
- Use a docker image cache for the prerequisites for the debian package build. ([\matrix-org#10431](matrix-org#10431))
- Improve servlet type hints. ([\matrix-org#10437](matrix-org#10437), [\matrix-org#10438](matrix-org#10438))
- Replace usage of `or_ignore` in `simple_insert` with `simple_upsert` usage, to stop spamming postgres logs with spurious ERROR messages. ([\matrix-org#10442](matrix-org#10442))
- Update the `tests-done` Github Actions status. ([\matrix-org#10444](matrix-org#10444), [\matrix-org#10512](matrix-org#10512))
- Update type annotations to work with forthcoming Twisted 21.7.0 release. ([\matrix-org#10446](matrix-org#10446), [\matrix-org#10450](matrix-org#10450))
- Cancel redundant GHA workflows when a new commit is pushed. ([\matrix-org#10451](matrix-org#10451))
- Mitigate media repo XSS attacks on IE11 via the non-standard X-Content-Security-Policy header. ([\matrix-org#10468](matrix-org#10468))
- Additional type hints in the state handler. ([\matrix-org#10482](matrix-org#10482))
- Update syntax used to run complement tests. ([\matrix-org#10488](matrix-org#10488))
- Fix up type annotations to work with Twisted 21.7. ([\matrix-org#10490](matrix-org#10490))
- Improve type annotations for `ObservableDeferred`. ([\matrix-org#10491](matrix-org#10491))
- Extend release script to also tag and create GitHub releases. ([\matrix-org#10496](matrix-org#10496))
- Fix a bug which caused production debian packages to be incorrectly marked as 'prerelease'. ([\matrix-org#10500](matrix-org#10500))
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants