80 Commits

Author SHA1 Message Date
Richard van der Hoff
73c759e4f7 Add some documentation on the log fields 2024-09-13 16:21:48 +01:00
Kegan Dougal
b383ed0d82 Add migrations and refactor internal structs 2024-05-17 13:45:14 +01:00
Kegan Dougal
905f815794 bugfix: ensure sentry username/id values are correct
Previously there were wrong under high concurrency due to
using the global hub instead of a per-request hub.
2024-03-05 11:30:05 +00:00
Kegan Dougal
51b851a48a Add live stream test; correctly calculate avatar changes 2024-01-22 11:33:09 +00:00
Kegan Dougal
08d3ec9745 only use the hero avatar if the room is a DM 2024-01-22 10:34:06 +00:00
Kegan Dougal
0bd026fc09 bugfix: correctly tell clients when the fallback key has been used
Fixes a class of unable to decrypt errors caused when the fallback
key was used but the client was unaware.
2024-01-04 17:06:28 +00:00
Boris Rybalkin
c1dca54666 revert assertCustom 2023-11-17 12:13:33 +00:00
Boris Rybalkin
8d38785ac0 back to util functions 2023-11-16 19:31:43 +00:00
Boris Rybalkin
b055d27d22 extract HomeServerUrl struct 2023-11-16 13:57:51 +00:00
David Robertson
9230cf9206
Fix sausage fingers
Co-authored-by: kegsay <kegan@matrix.org>
2023-10-19 17:31:48 +01:00
David Robertson
904d16f450
Fix keys() return value starting with zero keys
Also pull this into `internal` so that other packages can reuse it

Hopefully we can use
https://pkg.go.dev/golang.org/x/exp@v0.0.0-20231006140011-7918f672742d/maps#Keys
one day
2023-10-19 14:06:43 +01:00
Kegan Dougal
f4026d4c1d Deep-copy pointer backed fields on room metadata
Fixes #345
2023-10-19 11:19:28 +01:00
kegsay
bf9e90127f
Merge pull request #299 from matrix-org/kegan/poll-retry-loop-bad-create-event
bugfix: don't wedge pollers when they get bad state blocks
2023-09-20 11:51:24 +01:00
Kegan Dougal
84c976e8e8 Additional tests; linting 2023-09-19 13:47:58 +01:00
Till Faelligen
ce99d0f911
Initial support for room heroes 2023-09-15 15:08:07 +02:00
Quentin Gliech
af5e8579b2 Better propagate request context
This properly propagates the go Context on down to all HTTP calls, which means that outgoing request have the OTLP trace context.
This also adds the Jaeger propagator to the list of OTEL propagators, so that Synapse properly gets the incoming trace context.
It also upgrades all the OTEL libraries
2023-09-13 19:41:52 +02:00
David Robertson
545f80673c
Log setup and processing times for requests
Closes #277.
2023-08-31 11:49:49 +01:00
Kegan Dougal
c5addab65d Add more OTLP tags
This makes it easier to xref with EX rageshakes
2023-08-24 11:24:08 +01:00
Kegan Dougal
2730e8f3b0 Configure basic auth correctly 2023-08-23 15:38:45 +01:00
Kegan Dougal
4fd1c3bc06 Configure OTLP URL correctly 2023-08-23 13:06:18 +01:00
Kegan Dougal
9ae4a04824 Move from Jaeger to OTLP exportor
Jaeger spans can be sent as OTLP so this is mostly semantics for
the collector, which is more flexible if it accepts OTLP traces
rather than jaeger.thrift traces.
2023-08-23 12:52:47 +01:00
Kegan Dougal
066327d407 Add internal.DataError to skip over bad responses
- Move processing of to-device msgs to the last thing, so we don't double process.
- Use internal.DataError when we fail to load a snapshot correctly i.e missing events in the snapshot.
2023-08-16 10:52:35 +01:00
Till Faelligen
9359bd5497
Only update required entries if we already got some 2023-08-03 17:38:34 +02:00
Kegan Dougal
8b6f48a24b Add more logging to response lines 2023-07-31 10:24:36 +01:00
Kegan Dougal
3536307204 Track buffer sizes in summary line 2023-07-24 14:42:02 +01:00
David Robertson
81b187d764
Merge pull request #208 from matrix-org/dmr/avatars2 2023-07-19 13:18:14 +01:00
David Robertson
6b9a2217f8
Track changes to avatars when computing deltas 2023-07-18 12:44:26 +01:00
David Robertson
7097c1d279
Track heroes' avatars 2023-07-18 12:44:26 +01:00
David Robertson
5913fbb0f3
Parse m.room.avatar 2023-07-18 12:44:25 +01:00
David Robertson
3861bac4c6
Don't create two Heroes slices to the same array
Otherwise you end up with two slices that share ownership of the same
data but don't coordinate between one another, see e.g.
https://go.dev/play/p/uk3o652Tvye
2023-07-18 12:44:25 +01:00
kegsay
7f2c4eafb1
Merge pull request #178 from matrix-org/dmr/debug-missing-data-at-startup
Debug missing roomIDs/event timestamps seen at startup
2023-07-18 02:46:58 -07:00
Kegan Dougal
b9bc83d93f Add WorkerPool and use it for OnE2EEData
- Allowing unlimited concurrency on OnE2EEData causes huge spikes in DB conns
  when device lists change.
- Using a high, bounded amount of concurrency ensure we don't breach DB conn limits.

With unit tests.
2023-06-28 16:32:23 -05:00
David Robertson
2829a7ae45
Log device ID after requests 2023-06-23 17:35:39 +01:00
David Robertson
f699eabeed
Debug missing roomIDs seen at startup
Sentry: https://sentry.tools.element.io/organizations/element/issues/70026/events/7080aeab1d0b402e987a18f26c1ac329/?project=56&query=is%3Aunresolved
2023-06-20 16:53:04 +01:00
David Robertson
969ee54693
Seed bump timestamps when creating a new conn
Clarify the fallback situation for a new list
2023-06-06 16:57:48 +01:00
David Robertson
38ee47c1fd
Merge remote-tracking branch 'origin/main' into dmr/bump-event-types-3 2023-06-05 13:35:38 +01:00
David Robertson
2c497008e4
Merge pull request #134 from matrix-org/dmr/sentry-pollers
Associate user IDs and device IDs to poller sentry reports
2023-06-05 11:34:21 +01:00
David Robertson
da118624d9
GlobalCache: load LatestEventsByType on startup 2023-06-01 20:05:42 +01:00
David Robertson
c0e0f8400e
Introduce const for the ss sentry context key 2023-05-25 21:55:18 +01:00
David Robertson
77473feee9
Don't error to Sentry when clients close conns 2023-05-25 20:00:40 +01:00
David Robertson
c953b391b3
Backout the LastMessageTimestamp changes
clarify that timestamps can decrease
2023-05-24 13:46:10 +01:00
David Robertson
f3dbc350ce
Make global cache's LastMessageTimestamp monotonic
I _think_ this is the intention?
2023-05-23 18:33:06 +01:00
David Robertson
191208c8e1
Comment on the room metadata structs
Closes #46.
2023-05-23 18:33:05 +01:00
David Robertson
4ef8205dba
Tweak comment 2023-05-17 18:07:23 +01:00
David Robertson
e908623fcb
Err, don't panic if there's nothing to panic about 2023-05-16 17:49:14 +01:00
David Robertson
85e68a2d94
Capture, report and reraise panics in Listen 2023-05-16 17:35:47 +01:00
David Robertson
14a3370da6
Merge branch 'main' into dmr/oidc 2023-05-16 12:28:53 +01:00
Kegan Dougal
6db92b9054 bugfix: ensure global metadata is consistently made correctly
On startup it was possible for it to miss ChildSpaceRooms which
would then cause a nil panic. With regression test.
2023-05-11 18:19:04 +01:00
David Robertson
e670812f11
setupConnection: lookup tokens, not devices 2023-04-28 01:37:45 +01:00
David Robertson
96471cb1b4
Associate mxids to requests in Sentry 2023-04-18 22:02:24 +01:00