Eric Eastwood
f6f079be41
Better docstring
2025-06-24 18:36:16 -05:00
Eric Eastwood
554673dd30
Use homeserver specific registry and combine in the metrics endpoint output
2025-06-24 18:24:52 -05:00
Eric Eastwood
ee51a45c45
Update doc comment further
2025-06-24 16:50:02 -05:00
Eric Eastwood
3277afd520
Refactor from hs.metrics_manager -> hs.get_metrics_manager()
...
This matches the pattern of other homeserver attributes like `hs.get_clock()`
2025-06-24 16:42:33 -05:00
Eric Eastwood
e46690c418
Add changelog
2025-06-24 16:35:30 -05:00
Eric Eastwood
6c39fc8a9a
Fix mypy complaining about unknown types by changing property order around
...
Fix mypy complaints
```
synapse/handlers/delayed_events.py:266: error: Cannot determine type of "validator" [has-type]
synapse/handlers/delayed_events.py:267: error: Cannot determine type of "event_builder_factory" [has-type]
```
2025-06-24 16:35:30 -05:00
Eric Eastwood
f46904272f
Make sure @measure_func usages have the necessary properties
2025-06-24 16:35:30 -05:00
Eric Eastwood
41dfb20253
Update measure_func to support HasClockAndMetricsManager
2025-06-24 16:14:33 -05:00
Eric Eastwood
c5296f5b6a
Refactor Measure in synapse/http/federation/well_known_resolver.py
2025-06-24 16:14:33 -05:00
Eric Eastwood
019f0b7b4f
Refactor bulk Measure usage
...
Not finished:
- `synapse/http/federation/well_known_resolver.py`
- `measure_func`
2025-06-24 16:14:33 -05:00
Eric Eastwood
96c9485a7c
Merge branch 'develop' into madlittlemods/per-hs-metrics-measure
2025-06-24 16:14:33 -05:00
Eric Eastwood
c07e1f502c
Add docstrings
2025-06-24 16:14:33 -05:00
Eric Eastwood
612cbd9439
Refactor InFlight block metrics to be HS specific
2025-06-24 16:14:33 -05:00
Eric Eastwood
420c83dbf9
Use global REGISTRY for now
2025-06-24 16:14:33 -05:00
dependabot[bot]
6fabf82f4f
Bump types-opentracing from 2.4.10.6 to 2.4.10.20250622 ( #18586 )
...
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-24 17:30:36 +01:00
Andrew Morgan
cb259eb206
1.133.0rc1
v1.133.0rc1
2025-06-24 11:59:23 +01:00
Andrew Morgan
6791e6e250
Unbreak unit tests with Twisted 25.5.0 by add parsePOSTFormSubmission arg to FakeSite ( #18577 )
...
Co-authored-by: anoa's Codex Agent <codex@amorgan.xyz >
2025-06-24 11:52:06 +01:00
Eric Eastwood
676a2cc774
Refactor block metrics to use HS specific registry
...
Fix `HomeserverMetricsManager` lints
Fix `metrics_manager` missing in `Measure` `__slots__`
2025-06-23 15:09:47 -05:00
V02460
3cabaa84ca
Update PyO3 to version 0.25 ( #18578 )
...
Updates `pyo3` to version 0.25.1 and, accordingly, `pyo3-log` to v0.12.4
and `pythonize` to v0.25.0.
PyO3 v0.25 enables Python 3.14 support.
2025-06-23 13:48:07 +01:00
Travis Ralston
74ca7ae720
Add report user API from MSC4260 ( #18120 )
...
Co-authored-by: turt2live <1190097+turt2live@users.noreply.github.com >
Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com >
2025-06-20 13:02:14 +01:00
Erik Johnston
5102565369
Fixup generated config documentation ( #18568 )
...
Somehow its got out of sync, picked up by CI on develop.
2025-06-18 16:40:52 +01:00
Erik Johnston
33e0c25279
Clean up old device_federation_inbox rows ( #18546 )
...
Fixes https://github.com/element-hq/synapse/issues/17370
2025-06-18 11:58:31 +00:00
Erik Johnston
73a38384f5
Merge branch 'master' into develop
2025-06-17 15:33:18 +01:00
dependabot[bot]
4a803e8257
Bump dawidd6/action-download-artifact from 9 to 11 ( #18556 )
...
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-17 13:47:42 +01:00
dependabot[bot]
51dbbbb40f
Bump types-requests from 2.32.0.20250328 to 2.32.4.20250611 ( #18558 )
...
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-17 13:43:01 +01:00
dependabot[bot]
6363d63822
Bump actions/setup-python from 5.5.0 to 5.6.0 ( #18555 )
...
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-17 13:42:28 +01:00
Erik Johnston
d1139ebfc1
1.132.0
v1.132.0
2025-06-17 13:16:57 +01:00
Erik Johnston
3e571561c9
Fix Cargo.lock after bad merge ( #18561 )
...
Broke in #18357
2025-06-17 11:01:32 +01:00
Erik Johnston
a3b80071cd
Always run schema workflow on develop ( #18551 )
...
... and release branches, so that we catch any problems that slip trough
PR review.
2025-06-17 10:57:34 +01:00
Erik Johnston
f500c7d982
Speed up MAS token introspection ( #18357 )
...
We do this by shoving it into Rust. We believe our python http client is
a bit slow.
Also bumps minimum rust version to 1.81.0, released last September (over
six months ago)
To allow for async Rust, includes some adapters between Tokio in Rust
and the Twisted reactor in Python.
2025-06-16 16:41:35 +01:00
dependabot[bot]
df04931f0b
Bump base64 from 0.21.7 to 0.22.1 ( #18559 )
...
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-16 16:33:51 +01:00
Kegan Dougal
f56670515b
bugfix: assert we always pass the create event to get_user_power_level ( #18545 )
...
The create event is required if there is no PL event, in which case the
creator gets PL100.
### 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 >
2025-06-13 16:32:24 +00:00
Kegan Dougal
db8a8d33fe
bugfix: calculate the PL for non-creators correctly in v11 rooms ( #18547 )
...
Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com >
2025-06-13 12:56:39 +01:00
Andrew Morgan
3b94e40cc8
Fix typo of Math.pow, ^ -> ** ( #18543 )
2025-06-13 11:36:21 +00:00
dependabot[bot]
6b1e3c9c66
Bump requests from 2.32.2 to 2.32.4 ( #18533 )
2025-06-13 12:34:38 +01:00
Erik Johnston
1709957395
Fix bug where sliding sync ignored room_id_to_include option ( #18535 )
...
This was correctly handled for the "fallback" case where the background
updates hadn't finished
---------
Co-authored-by: Eric Eastwood <erice@element.io >
2025-06-13 11:29:23 +01:00
Quentin Gliech
0de7aa9953
Enable flake8-logging and flake8-logging-format rules in Ruff and fix related issues throughout the codebase ( #18542 )
...
This can be reviewed commit by commit.
This enables the `flake8-logging` and `flake8-logging-format` rules in
Ruff, as well as logging exception stack traces in a few places where it
makes sense
- https://docs.astral.sh/ruff/rules/#flake8-logging-log
- https://docs.astral.sh/ruff/rules/#flake8-logging-format-g
### Linting to avoid pre-formatting log messages
See [`adamchainz/flake8-logging` -> *LOG011 avoid pre-formatting log
messages*](https://github.com/adamchainz/flake8-logging/blob/152db2f167355fb23e401bf68046c57cb128a2ae/README.rst#log011-avoid-pre-formatting-log-messages )
Practically, this means prefer placeholders (`%s`) over f-strings for
logging.
This is because placeholders are passed as args to loggers, so they can
do special handling of them.
For example, Sentry will record the args separately in their logging
integration:
https://github.com/getsentry/sentry-python/blob/c15b390dfe1ca5c01b30dd56b35d693bb50b413c/sentry_sdk/integrations/logging.py#L280-L284
One theoretical small perf benefit is that log levels that aren't
enabled won't get formatted, so it doesn't unnecessarily create
formatted strings
2025-06-13 09:44:18 +02:00
Will Hunt
e4ca593eb6
Log user deactivations ( #18541 )
...
One liner to give us more clarity when auditing deactivations of user
accounts.
### Pull Request Checklist
<!-- Please read
https://element-hq.github.io/synapse/latest/development/contributing_guide.html
before submitting your pull request -->
* [ ] Pull request is based on the develop branch
* [ ] 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.
* [ ] [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 ))
2025-06-12 10:21:39 +00:00
Kegan Dougal
978032141b
bugfix: ensure _get_power_level_for_sender works when there is no PL event ( #18534 )
2025-06-10 15:11:49 +01:00
dependabot[bot]
142ba5df89
Bump headers from 0.4.0 to 0.4.1 ( #18529 )
...
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-10 14:38:54 +01:00
Andrew Morgan
eb5dfc19e5
Merge branch 'release-v1.132' into develop
2025-06-10 12:55:36 +01:00
reivilibre
cc6b4980ef
Add config doc generation command to lint.sh and add missing config schema. ( #18522 )
...
Follows: #17892 , #18456
<ol>
<li>
Add config doc generation command to lint.sh
</li>
<li>
Add missing `user_types` config schema
</li>
</ol>
---------
Signed-off-by: Olivier 'reivilibre <oliverw@matrix.org >
2025-06-10 12:45:31 +01:00
reivilibre
d5da07703d
Config schema documentation CI: fix not failing when it should ( #18528 )
...
Follows: #17892 <!-- -->
<ol>
<li>
Config documentation CI: fix not failing if changes are outstanding
</li>
</ol>
Shown to work at :
https://github.com/element-hq/synapse/actions/runs/15532406886/job/43724019104?pr=18528
---------
Signed-off-by: Olivier 'reivilibre <oliverw@matrix.org >
2025-06-10 12:44:04 +01:00
reivilibre
96c556081a
Add config doc generation command to lint.sh and add missing config schema. ( #18522 )
...
Follows: #17892 , #18456
<ol>
<li>
Add config doc generation command to lint.sh
</li>
<li>
Add missing `user_types` config schema
</li>
</ol>
---------
Signed-off-by: Olivier 'reivilibre <oliverw@matrix.org >
2025-06-10 12:43:58 +01:00
Andrew Morgan
5581fbb906
1.132.0rc1
v1.132.0rc1
2025-06-10 11:18:17 +01:00
Andrew Morgan
1ab35a0a78
Mark new module APIs as experimental ( #18536 )
2025-06-10 11:13:47 +01:00
nexy7574
341d956ee6
Default to public join rule in remote summary ( #18493 )
...
See: https://github.com/element-hq/synapse/issues/18358#issuecomment-2866119550
2025-06-09 10:59:49 +00:00
Emmanuel Ferdman
6521406a37
Migrate to assertEqual ( #18488 )
...
This small PR migrates from `unittest.assertEquals` to
`unittest.assertEqual` which is deprecated from Python2.7:
```python
DeprecationWarning: Please use assertEqual instead.
```
Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com >
2025-06-06 16:14:09 +01:00
Will Hunt
6e600c986e
Don't allow users to ignore themselves. ( #18508 )
...
Fixes the self-ignore issues we've being seeing of reports of by
ignoring bad requests from clients.
Fixes https://github.com/element-hq/synapse/issues/11963
Fix https://github.com/element-hq/element-web/issues/29969 although this
should also be fixed on the client to avoid confusing errors popping up
while rejecting invites.
Related to https://github.com/matrix-org/matrix-rust-sdk/issues/5073
2025-06-06 15:37:15 +01:00
Will Hunt
d285d76185
Recover an appservice if a successful ping occurs. ( #18521 )
...
Fixes https://github.com/element-hq/synapse/issues/14240
This scratches an itch that i've had for years. We regularly run into
the issue where (especially in development) appservices can go down for
a period and them come back up. The ping endpoint was introduced some
time ago which means Synapse can determine if an AS is up more or less
immediately, so we might as well use that to schedule transaction
redelivery.
I believe transaction scheduling logic is largely implementation
specific, so we should be in the clear to do this without any spec
changes.
2025-06-06 11:59:38 +00:00