Commit graph

23978 commits

Author SHA1 Message Date
Eric Eastwood 63c7b5017a (doesn't work) Add test for batch persisting multiple member events for the same user 2024-06-27 16:34:41 -05:00
Eric Eastwood 325856e14b Inclusive ranges 2024-06-27 15:57:01 -05:00
Eric Eastwood f77403251c Add better comments 2024-06-27 15:39:43 -05:00
Eric Eastwood ba56350642 Passing current tests 2024-06-27 15:31:18 -05:00
Eric Eastwood eb159c11cd Don't worry about state_reset for now
See:

 - Why no `COALESCE` https://github.com/element-hq/synapse/pull/17320#discussion_r1657435662
 - Don't worry about `state_reset` for now, https://github.com/element-hq/synapse/pull/17320#discussion_r1657562645
2024-06-27 14:38:55 -05:00
Eric Eastwood 81c06bec20 Detect state resets 2024-06-27 11:50:18 -05:00
Eric Eastwood 15fcead2a5 Slight clean-up 2024-06-27 11:33:41 -05:00
Eric Eastwood 830e09d2de Grab prev_membership to see whether the server left the room (fixes tests)
See https://github.com/element-hq/synapse/pull/17320#discussion_r1657170493

`prev_membership` helps determine whether we should include the `event_id=null` row because
we can check whether we have already left.

 - When we leave the room causing the server to leave the room, the `prev_event_id` will be our join event
 - When the server leaves the room after us, the `prev_event_id` will be leave event
 - In the state reset case, `prev_event_id` will be our join event
2024-06-27 10:20:33 -05:00
Eric Eastwood 956f20ef74 (currently failing) Add test to make sure membership changes don't re-appear if the server leaves the room later 2024-06-27 01:24:37 -05:00
Eric Eastwood f163fcf08a Remove need for topological_ordering 2024-06-27 01:21:49 -05:00
Eric Eastwood 935b98c474 All get_current_state_delta_membership_changes_for_user(...) tests passing 2024-06-27 00:49:51 -05:00
Eric Eastwood 7eb1806ee3 Fix lints 2024-06-26 21:06:05 -05:00
Eric Eastwood b7914e7676 Add skipped test for state resets 2024-06-26 21:01:54 -05:00
Eric Eastwood 8df39d1baf Remove redundant instance_name column 2024-06-26 20:22:03 -05:00
Eric Eastwood 2a944ffcef Add state of the db in each situation 2024-06-26 20:20:17 -05:00
Eric Eastwood 48d0acfbcd Actually test get_current_state_delta_membership_changes_for_user(...) in remote join test 2024-06-26 19:52:12 -05:00
Eric Eastwood 0b9a903ca1 Add test that remotely joins room 2024-06-26 19:35:18 -05:00
Eric Eastwood ec2d8dc1e3 Create events using helper 2024-06-26 18:52:24 -05:00
Eric Eastwood 2bf39231ed Add some tests for get_current_state_delta_membership_changes_for_user(...) 2024-06-26 18:40:36 -05:00
Eric Eastwood 7395e10420 Fix builtins.SyntaxError: EOL while scanning string literal (test_sync.py, line 1885)
See https://github.com/element-hq/synapse/actions/runs/9675073109/job/26692003103?pr=17320#step:9:5552

Worked fine locally but failed in CI with Python 3.8
2024-06-26 02:19:31 -05:00
Eric Eastwood 11db1befa2 Remove debug log 2024-06-26 02:05:25 -05:00
Eric Eastwood c60aca755b Fix clause change 2024-06-26 02:02:34 -05:00
Eric Eastwood 5c213158d7 Merge branch 'develop' into madlittlemods/sliding-sync-room-data
Conflicts:
	tests/rest/client/test_sync.py
2024-06-26 01:36:23 -05:00
Eric Eastwood 39259f66fa Join both tables with stream_ordering 2024-06-26 01:16:46 -05:00
Eric Eastwood 62c6a4e860 Add newly_joined support to get_sync_room_ids_for_user(...) 2024-06-26 01:10:00 -05:00
Eric Eastwood cccbd15e7e Refactor back to not pulling out full events 2024-06-25 23:40:55 -05:00
Eric Eastwood daa7e3691a Add docstring 2024-06-25 23:01:28 -05:00
Eric Eastwood d91aa0018c Remove extras 2024-06-25 22:45:59 -05:00
Eric Eastwood fb8fbd489c Just fetch full events for get_current_state_delta_membership_changes_for_user(...)
Makes downstream logic simpler and although we may look-up some events
we don't use, the lookup is all done in one go instead of fetching events
from event_ids in a couple different places.
2024-06-25 22:37:45 -05:00
Eric Eastwood 27d74b023e Iterate 2024-06-25 22:20:27 -05:00
Eric Eastwood 6c791a88b3 WIP: Add back newly_left 2024-06-25 21:07:19 -05:00
Eric Eastwood fbd92e1c9d Add get_current_state_delta_membership_changes_for_user(...) (using current_state_delta_stream)
(still need to add newly_left rooms back)
2024-06-25 20:16:50 -05:00
Eric Eastwood 83d6f76606 Describe current_state_delta_stream better 2024-06-25 15:27:49 -05:00
Eric Eastwood 4c22131442 Start testing for the correct room membership (failing) 2024-06-25 15:27:43 -05:00
Eric Eastwood 303d834b78 Add tracking discussion for not optional in the future 2024-06-25 12:38:09 -05:00
Eric Eastwood e3e431fab4 Finish up stripped_state for invite rooms
See https://github.com/element-hq/synapse/pull/17320#discussion_r1646581077
2024-06-25 12:35:50 -05:00
Eric Eastwood 7aea406c22 Just stripped_state for invite rooms 2024-06-25 11:18:27 -05:00
Andrew Morgan ef7fbdfebd
Fixes to the table of contents in the README (#17329) 2024-06-25 15:20:59 +00:00
Denis Kasak 9cf0ef9c70
Fix outdated Security Disclosure Policy references (#17341) 2024-06-25 15:58:30 +01:00
Shay a023538822
Re-introduce federation /download endpoint (#17350) 2024-06-25 14:35:37 +00:00
douglaz f79dbd0f61
Fix refreshable_access_token_lifetime typo (#17357)
Simple typo in the docs
2024-06-25 12:07:13 +01:00
Erik Johnston c89fea3fd1
Limit amount of replication we send (#17358)
Fixes up #17333, where we failed to actually send less data (the
`DISTINCT` didn't work due to `stream_id` being different).

We fix this by making it so that every device list outbound poke for a
given user ID has the same stream ID. We can't change the query to only
return e.g. max stream ID as the receivers look up the destinations to
send to by doing `SELECT WHERE stream_id = ?`
2024-06-25 11:17:39 +01:00
Erik Johnston 554a92601a
Reintroduce "Reduce device lists replication traffic."" (#17361)
Reintroduces https://github.com/element-hq/synapse/pull/17333


Turns out the reason for revert was down two master instances running
2024-06-25 10:34:34 +01:00
Erik Johnston a98cb87bee
Revert "Reduce device lists replication traffic." (#17360)
Reverts element-hq/synapse#17333

It looks like master was still sending out replication RDATA with the
old format... somehow
2024-06-25 09:57:34 +01:00
Eric Eastwood 3568311989 Fix spelling typo 2024-06-24 19:08:18 -05:00
Eric Eastwood 6e8af83193
Add is_invite filtering to Sliding Sync /sync (#17335)
Based on [MSC3575](https://github.com/matrix-org/matrix-spec-proposals/pull/3575): Sliding Sync
2024-06-24 19:07:56 -05:00
Eric Eastwood 21ca02c5ad newly_joined vs limited already being tracked in a discussion
See https://github.com/element-hq/synapse/pull/17320#discussion_r1646579623
if anything comes out of it.
2024-06-24 16:08:58 -05:00
Eric Eastwood 0e71a2f2d1 Add TODO for filtering call invites in public rooms 2024-06-24 15:56:27 -05:00
devonh 805e6c9a8f
Correct error in user_directory docs (#17348)
### Pull Request Checklist

<!-- Please read
https://element-hq.github.io/synapse/latest/development/contributing_guide.html
before submitting your pull request -->

* [X] Pull request is based on the develop branch
* [X] Pull request includes a [changelog
file](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#changelog).
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.
- Feel free to credit yourself, by adding a sentence "Contributed by
@github_username." or "Contributed by [Your Name]." to the end of the
entry.
* [X] [Code
style](https://element-hq.github.io/synapse/latest/code_style.html) is
correct
(run the
[linters](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#run-the-linters))

---------

Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
Co-authored-by: reivilibre <oliverw@matrix.org>
2024-06-24 17:18:58 +00:00
devonh 3c61ddbbc9
Add default values for rc_invites per_issuer to docs (#17347)
A simple change to update the docs where default values were missing.

### Pull Request Checklist

<!-- Please read
https://element-hq.github.io/synapse/latest/development/contributing_guide.html
before submitting your pull request -->

* [X] Pull request is based on the develop branch
* [X] Pull request includes a [changelog
file](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#changelog).
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.
- Feel free to credit yourself, by adding a sentence "Contributed by
@github_username." or "Contributed by [Your Name]." to the end of the
entry.
* [X] [Code
style](https://element-hq.github.io/synapse/latest/code_style.html) is
correct
(run the
[linters](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#run-the-linters))

---------

Co-authored-by: Kim Brose <2803622+HarHarLinks@users.noreply.github.com>
Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
2024-06-24 17:16:09 +00:00