From 18f1d28a498c8ac18a7f8b3fdb778af2f0954fc4 Mon Sep 17 00:00:00 2001 From: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> Date: Fri, 7 Nov 2025 10:41:05 +0000 Subject: [PATCH 1/3] 1.142.0rc1 regression fix: Allow coercing a `str` to a `FilePath` in `MasConfigModel` (#19144) --- changelog.d/19144.bugfix | 1 + synapse/config/mas.py | 3 ++- synapse/util/pydantic_models.py | 7 +++++++ 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 changelog.d/19144.bugfix diff --git a/changelog.d/19144.bugfix b/changelog.d/19144.bugfix new file mode 100644 index 000000000..3efec8080 --- /dev/null +++ b/changelog.d/19144.bugfix @@ -0,0 +1 @@ +Fix a bug introduced in 1.142.0rc1 where any attempt to configure `matrix_authentication_service.secret_path` would prevent the homeserver from starting up. \ No newline at end of file diff --git a/synapse/config/mas.py b/synapse/config/mas.py index 53cf500e9..c3e2630f2 100644 --- a/synapse/config/mas.py +++ b/synapse/config/mas.py @@ -37,7 +37,8 @@ class MasConfigModel(ParseModel): enabled: StrictBool = False endpoint: AnyHttpUrl = AnyHttpUrl("http://localhost:8080") secret: Optional[StrictStr] = Field(default=None) - secret_path: Optional[FilePath] = Field(default=None) + # We set `strict=False` to allow `str` instances. + secret_path: Optional[FilePath] = Field(default=None, strict=False) @model_validator(mode="after") def verify_secret(self) -> Self: diff --git a/synapse/util/pydantic_models.py b/synapse/util/pydantic_models.py index e1e2d8b99..506063d1a 100644 --- a/synapse/util/pydantic_models.py +++ b/synapse/util/pydantic_models.py @@ -30,6 +30,13 @@ class ParseModel(BaseModel): but otherwise uses Pydantic's default behaviour. + Strict mode can adversely affect some types of fields, and should be disabled + for a field if: + + - the field's type is a `Path` or `FilePath`. Strict mode will refuse to + coerce from `str` (likely what the yaml parser will produce) to `FilePath`, + raising a `ValidationError`. + For now, ignore unknown fields. In the future, we could change this so that unknown config values cause a ValidationError, provided the error messages are meaningful to server operators. From 5d4a73149919b52a6f286e8964121ccb2467620c Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Fri, 7 Nov 2025 10:54:55 +0000 Subject: [PATCH 2/3] 1.142.0rc4 --- CHANGES.md | 9 +++++++++ changelog.d/19144.bugfix | 1 - debian/changelog | 6 ++++++ pyproject.toml | 2 +- 4 files changed, 16 insertions(+), 2 deletions(-) delete mode 100644 changelog.d/19144.bugfix diff --git a/CHANGES.md b/CHANGES.md index ab9b72e2a..7bb0ece7e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,12 @@ +# Synapse 1.142.0rc4 (2025-11-07) + +## Bugfixes + +- Fix a bug introduced in 1.142.0rc1 where any attempt to configure `matrix_authentication_service.secret_path` would prevent the homeserver from starting up. ([\#19144](https://github.com/element-hq/synapse/issues/19144)) + + + + # Synapse 1.142.0rc3 (2025-11-04) ## Dropped support for Python 3.9 diff --git a/changelog.d/19144.bugfix b/changelog.d/19144.bugfix deleted file mode 100644 index 3efec8080..000000000 --- a/changelog.d/19144.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fix a bug introduced in 1.142.0rc1 where any attempt to configure `matrix_authentication_service.secret_path` would prevent the homeserver from starting up. \ No newline at end of file diff --git a/debian/changelog b/debian/changelog index 0dae01285..6531a5956 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +matrix-synapse-py3 (1.142.0~rc4) stable; urgency=medium + + * New Synapse release 1.142.0rc4. + + -- Synapse Packaging team Fri, 07 Nov 2025 10:54:42 +0000 + matrix-synapse-py3 (1.142.0~rc3) stable; urgency=medium * New Synapse release 1.142.0rc3. diff --git a/pyproject.toml b/pyproject.toml index 991cb3e7f..f81c1e6ba 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -107,7 +107,7 @@ module-name = "synapse.synapse_rust" [tool.poetry] name = "matrix-synapse" -version = "1.142.0rc3" +version = "1.142.0rc4" description = "Homeserver for the Matrix decentralised comms protocol" authors = ["Matrix.org Team and Contributors "] license = "AGPL-3.0-or-later OR LicenseRef-Element-Commercial" From 72073d82ae339700a07486d32f2d2c29c67cce4c Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Fri, 7 Nov 2025 11:20:20 +0000 Subject: [PATCH 3/3] Move important messages to the top of the changelog --- CHANGES.md | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 7bb0ece7e..8fbd50f20 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,14 +1,5 @@ # Synapse 1.142.0rc4 (2025-11-07) -## Bugfixes - -- Fix a bug introduced in 1.142.0rc1 where any attempt to configure `matrix_authentication_service.secret_path` would prevent the homeserver from starting up. ([\#19144](https://github.com/element-hq/synapse/issues/19144)) - - - - -# Synapse 1.142.0rc3 (2025-11-04) - ## Dropped support for Python 3.9 This release drops support for Python 3.9, in line with our [dependency @@ -38,6 +29,14 @@ of these wheels downstream, please reach out to us in [#synapse-dev:matrix.org](https://matrix.to/#/#synapse-dev:matrix.org). We'd love to hear from you! +## Bugfixes + +- Fix a bug introduced in 1.142.0rc1 where any attempt to configure `matrix_authentication_service.secret_path` would prevent the homeserver from starting up. ([\#19144](https://github.com/element-hq/synapse/issues/19144)) + + + + +# Synapse 1.142.0rc3 (2025-11-04) ## Internal Changes