1
0
Fork 0
forked from mirror/grapevine
Commit graph

2620 commits

Author SHA1 Message Date
Benjamin Lee
827f670c54
add changelog entries for the account data validation fixes 2024-08-11 15:53:25 -07:00
Benjamin Lee
a32dc1a3ee
tolerate invalid m.direct events when upgrading rooms
Previous behavior was causing us to error out of the entire
state_cache::update_membership function when it saw an invalid m.direct,
making it impossible for affected users to join upgraded rooms. This bug
is especially bad if an affected user attempts to upgrade a room,
because we will fail to create their join event in the new room, leaving
both rooms permanently bricked.

The new behavior should never prevent users from joining a room based on
the contents of their account data, and should migrate the `m.direct`
event in a reasonable way even if it is partially corrupted by the
element bug.

This also fixes a bug where the previous implementation will
unintentionally remove any keys that aren't part of the expected
m.direct schema. I don't know of any cases where this came up in
practice.

Fixes: #46
2024-08-11 15:53:25 -07:00
Benjamin Lee
18360cd3f9
refactor error handling in copy_upgraded_account_data_tag
The new error handling logic is semantically different from the old, but
I don't know of any cases you could hit in practice where it would
matter.
2024-08-11 15:53:24 -07:00
Benjamin Lee
51dd75c3dc
factor account data upgrade logic into functions
The implementation inside each function is unchanged from the original.
I intend to clean up and fix bugs in later commits, so the diff will be
more clear.
2024-08-11 15:53:24 -07:00
Lambda
dd24a44112 Use TokenSet for roomid_mutex_federation 2024-07-22 18:07:03 +00:00
Lambda
4893c54f4f Use TokenSet for roomid_mutex_insert 2024-07-22 18:07:03 +00:00
Lambda
34ccb2cd06 Use TokenSet for roomid_mutex_state 2024-07-22 18:07:03 +00:00
Lambda
07b5233980 Use OnDemandHashMap for servername_ratelimiter
This way, semaphores are actually cleaned up eventually.
2024-07-22 18:07:03 +00:00
Lambda
2c19abc535 Add OnDemandHashMap and TokenSet 2024-07-22 18:07:00 +00:00
Lambda
aea6019c0a upgrade_room_route: fix state lock
This was using the lock for the replacement room to send events to the
original room, which may or may not cause problems.
2024-07-22 18:06:11 +00:00
Lambda
ef1b6fe111 upgrade_room_route: give more descriptive names to locks
This makes the next commit, which is an actual fix, much easier to read.
2024-07-22 18:06:11 +00:00
tranquillity-codes
c70cfd3d25
Return 504 when a file is missing to be by-spec
The spec defines that the media endpoints should return 504 when a file
is not-yet-uploaded, which has been interpreted to include when a file
was deleted. Modifies the /media/v3/download/ and /media/r0/thumbnail
endpoints.
2024-07-21 20:42:07 -07:00
Charles Hall
bf799c1fa1
update changelog 2024-07-16 11:16:08 -07:00
Charles Hall
96e6ac9563
fix service/rooms/spaces events 2024-07-16 11:16:08 -07:00
Charles Hall
b4d81bb067
fix service/rooms/event_handler events 2024-07-16 11:16:08 -07:00
Charles Hall
4b5d127368
fix service/rooms/state_cache events 2024-07-16 11:16:08 -07:00
Charles Hall
592e42ba7d
fix service/rooms/timeline events 2024-07-16 11:16:08 -07:00
Charles Hall
ee95b6be3c
fix api/client_server/sync events
Some duplicated-ish code from src/database/key_value/rooms/timeline.rs
about handling errors from `pdus_since`/`pdus_until`, it seems like the
error message was actually directly copy-pasted from there because it
referred to the wrong function lol
2024-07-16 11:16:08 -07:00
Charles Hall
dacb2ae7dd
fix api/client_server/context events 2024-07-16 11:12:08 -07:00
Charles Hall
4b9c6a754c
fix api/client_server/room events 2024-07-16 11:12:08 -07:00
Charles Hall
196c923a5a
fix api/client_server/account events 2024-07-16 11:12:08 -07:00
Charles Hall
d2fc2fad1f
fix service/rooms/state events 2024-07-16 11:12:08 -07:00
Charles Hall
1283dc6477
fix service/rooms/state_accessor events 2024-07-16 11:12:08 -07:00
Charles Hall
e7087444db
fix service/sending events 2024-07-16 11:12:08 -07:00
Charles Hall
60b89aba78
fix api/client_server/session events
And also add a new event for logging out to match the one for logging in
because why not.
2024-07-16 11:12:08 -07:00
Charles Hall
0aef00c58b
fix api/client_server/keys events 2024-07-16 11:12:08 -07:00
Charles Hall
42e397203a
fix service/pdu events 2024-07-16 11:12:08 -07:00
Charles Hall
7392880bf8
fix utils/error events 2024-07-16 11:12:08 -07:00
Charles Hall
5a376ceb0a
fix database/key_value/rooms/timeline events 2024-07-16 11:12:08 -07:00
Charles Hall
52decf0cea
fix service/pusher events 2024-07-16 11:12:07 -07:00
Charles Hall
9d8e1a1490
fix api/server_server events 2024-07-16 11:12:07 -07:00
Charles Hall
db666fe903
fix api/client_server/directory events 2024-07-16 11:12:07 -07:00
Charles Hall
b6cba0c4ae
extract closure into a function
This was mostly written by using rust-analyzer's "extract to function"
and "extract to variable" functionality.
2024-07-16 11:12:07 -07:00
Charles Hall
a7cdbab44a
fix database events 2024-07-16 11:12:07 -07:00
Charles Hall
e49fe04f10
fix api/appservice_server events 2024-07-16 11:12:07 -07:00
Charles Hall
162d01f615
fix service/uiaa events 2024-07-16 11:12:07 -07:00
Charles Hall
37beaea48b
fix main events 2024-07-16 11:12:07 -07:00
Charles Hall
f5e10f5a8f
fix api/ruma_wrapper/axum events 2024-07-16 11:12:07 -07:00
Charles Hall
ca4f780c93
fix api/client_server/membership events 2024-07-16 11:12:07 -07:00
Lambda
b05c91b13e
Update changelog for config organization changes
Charles wrote item 12 in the "Added" section.

Co-authored-by: Charles Hall <charles@computer.surgery>
2024-06-27 16:18:21 -07:00
Lambda
f89e1c7dfc
Allow tracing filters to be changed at runtime
ReloadHandle is taken from conduwuit commit
8a5599adf9eafe9111f3d1597f8fb333b8b76849, authored by Benjamin.

Co-authored-by: Benjamin Lee <benjamin@computer.surgery>
2024-06-27 16:04:23 -07:00
Lambda
f576aff7eb
Don't accidentally ignore observability errors 2024-06-27 16:04:23 -07:00
Lambda
5a6e4fac73
Move federation config to separate config section
This renames:

allow_federation -> federation.enable
trusted_servers -> federation.trusted_servers
max_fetch_prev_events -> federation.max_fetch_prev_events
max_concurrent_requests -> federation.max_concurrent_requests
2024-06-27 16:04:23 -07:00
Lambda
e0e7d8fd91
Make observability more configurable
The following are now configurable:

- the OpenTelemetry endpoint,
- the tracing-flame filename, and
- whether the log output should include timestamps (useful to disable if
  it goes straight into journald).
2024-06-27 16:04:23 -07:00
Lambda
df571818f1
Make tracing filters configurable per backend 2024-06-27 16:04:23 -07:00
Lambda
98d49554ce
Move observability config to separate config section
This renames:

allow_prometheus -> observability.metrics.enable
allow_jaeger -> observability.traces.enable
tracing_flame -> observability.flame.enable
log -> observability.logs.filter
log_colors -> observability.logs.colors
log_format -> observability.logs.format

New config values in these sections will follow.
2024-06-27 16:04:23 -07:00
Lambda
8a30817930
config: convert database backend to enum
This reports a nice error when the config is loaded, rather than later
when the database is initialized.
2024-06-27 16:04:23 -07:00
Lambda
d26b87a2f2
Move database config to separate section
This renames:

database_backend -> database.backend
database_path -> database.path
db_cache_capacity_mb -> database.cache_capacity_mb
rocksdb_max_open_files -> database.rocksdb_max_open_files

Charles updated the NixOS module.

Co-authored-by: Charles Hall <charles@computer.surgery>
2024-06-27 16:03:43 -07:00
Lambda
79d5d306cc Move TURN config to separate config section
This renames:

turn_username -> turn.username
turn_password -> turn.password
turn_uris -> turn.uris
turn_secret -> turn.secret
turn_ttl -> turn.ttl
2024-06-27 18:16:37 +00:00
Lambda
e911518aac config: make db_cache_capacity_mb field unconditional
This is also used by sqlite, causing builds with `--no-default-features
--features sqlite` to fail.
2024-06-27 18:16:37 +00:00