Commit graph

23990 commits

Author SHA1 Message Date
Eric Eastwood a4d94b5117
Merge 32b8b68df6 into 27756c9fdf 2024-06-27 18:14:01 -05:00
Eric Eastwood 32b8b68df6 Add TODO to handle state resets
See https://github.com/element-hq/synapse/pull/17320#discussion_r1656548733
2024-06-27 18:13:34 -05:00
Eric Eastwood 1158058aa5 Opt for tackling more batch scenarios in future PRs 2024-06-27 17:58:31 -05:00
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
Till 27756c9fdf
Use rstcheck to "lint" the README (#17367)
Follow up to https://github.com/element-hq/synapse/pull/17363, so we can
detect issues with the RST file early on.


### 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))
2024-06-27 13:36:08 +02:00
Erik Johnston cc5e5893fe
Handle multiple rows device inbox (#17362)
Fix bug where we don't get new to-device from remote if they resent a
message we've already persisted and have recorded in the DB twice.

`device_federation_inbox` table doesn't have a unique index, and so we
can race and store an entry in there twice. If we do so then
`simple_select_one_txn` will throw an error due to the query returning
more than one row. We should add an unique index, but it doesn't really
matter so lets just handle the case of multiple rows correctly for now.
2024-06-27 11:04:31 +01: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
Till Faelligen 7c169f4d2c
Merge branch 'release-v1.110' into develop 2024-06-26 19:00:51 +02:00
Till Faelligen f75da9cc53
1.110.0rc2 2024-06-26 18:14:57 +02:00
Till 75c19bf57a
Fix uploading packages to PyPi (#17363)
As per
https://github.com/sphinx-doc/sphinx/issues/3921#issuecomment-315581557,
we need double underscores.
Running `rst2html README.rst > /dev/null` found some more warnings.
2024-06-26 18:14:29 +02:00
Till b924a8e1a9
Fix uploading packages to PyPi (#17363)
As per
https://github.com/sphinx-doc/sphinx/issues/3921#issuecomment-315581557,
we need double underscores.
Running `rst2html README.rst > /dev/null` found some more warnings.
2024-06-26 18:01:39 +02:00
Till Faelligen a8dcd686fb
Fix typo 2024-06-26 15:10:49 +02:00
Till Faelligen 315b8d2032
Update changelog 2024-06-26 14:39:57 +02:00
Till Faelligen 9f47513458
1.110.0rc1 2024-06-26 14:09:13 +02: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