162 Commits

Author SHA1 Message Date
Kegan Dougal
59cddd08c7 bugfix: update the 'name' field on rooms when relevant actions occur
Relevant actions include:
 - People joining/leaving a room
 - An m.room.name or m.room.canonical_alias event is sent
 - etc..

Prior to this, we just set the room name field for initial=true
rooms only. This meant that if a room name was updated whilst it was
in the visible range (or currently subscribed to), we wouldn't set
this field resulting in stale names for clients. This was particularly
prominent when you created a room, as the initial member event would
cause the room to appear in the list as "Empty room" which then would
never be updated even if there was a subsequent `m.room.name` event
sent.

Fixed with regression tests.
2022-08-11 15:07:36 +01:00
Kegan Dougal
54e1cfbb0e bugfix: ensure newly joined live-stream rooms don't cause 500s
This was caused by the GlobalCache not having a metadata entry for
the new room, which in some cases prevented a stub from being made.

With regression test.
2022-08-10 19:48:03 +01:00
Kegan Dougal
a314b29b58 Add test for space filter changes correctly invalidating/syncing new rooms 2022-08-02 15:20:23 +01:00
Kegan Dougal
0c52fac9a6 bugfix: when space children are modified, notify both the parent and child
Previously we would only notify the parent (in the case of m.space.child events)
which would cause lists tracking a space to not be aware of the change in
membership.
2022-08-02 15:11:15 +01:00
Kegan Dougal
6ac58d0e0e Add security tests for spaces filters
Because the spaces filter is user controlled, malicious users can
insert room IDs they are not joined to or should not be aware of.
We need to check that this does not leak any data or metadata.
2022-07-29 16:22:26 +01:00
Kegan Dougal
7ac03c46ca Add end-to-end spaces test; tweak e2e script; fix embarrassing negation bug
- Tests exercise multiple pre-configured spaces as well as adding/removing children on the fly.
- E2E run-tests.sh script now uses `$@` to pass through args to `go test` for running e2e tests with timeouts/single tests/etc
- Spaces are deleted when there is no valid `via` key, not when there is(!)
2022-07-29 16:04:12 +01:00
Kegan Dougal
a40441e963 Migrate lists_test to end-to-end tests
Add more helper functions like `WithPos` and `MatchTimeline`.
2022-07-26 17:54:58 +01:00
Kegan Dougal
86570aaff4 Migrate membership transitions test to e2e tests; add README 2022-07-26 12:24:05 +01:00
Kegan Dougal
7133ee0c51 Migrate security tests to e2e tests 2022-07-26 11:39:19 +01:00
Kegan Dougal
1e8ca38f79 e2e tests: add prev_batch tests
Uses a client theived from Complement since it does exactly what I want.
2022-07-25 17:51:26 +01:00
Kegan Dougal
f4e5bca26c Bump go version; rename GHA jobs 2022-07-25 15:13:24 +01:00
Kegan Dougal
75c3579f9e refactor: move integration tests to tests-integration directory
Add tests-e2ee directory for end-to-end tests which require a synapse
server.
2022-07-25 15:06:13 +01:00