From 354a5b449077478b141683bafbab47c9dc169d21 Mon Sep 17 00:00:00 2001 From: Dennis Fink Date: Mon, 16 Nov 2026 22:21:19 +0100 Subject: feat(receiver): add sorting and page size controls Allow received Webmentions to be sorted by status, source, target, received time, or updated time with stable pagination and accessible sortable headers. Add configurable per-page sizing and preserve sorting, filters, and page size across pagination and administrative actions. --- tests/test_config.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'tests/test_config.py') diff --git a/tests/test_config.py b/tests/test_config.py index a4c5e9b..d075e7d 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -354,11 +354,18 @@ def test_resource_limits_have_safe_defaults() -> None: assert DefaultConfig.MAX_CONTENT_LENGTH == 64 * 1024 assert DefaultConfig.MAX_WEBMENTION_URL_BYTES == 8192 assert DefaultConfig.RECEIVED_RETENTION_DAYS == 30 + assert DefaultConfig.RECEIVED_MAX_PAGE_SIZE == 100 assert DefaultConfig.RECEIVED_RETENTION_SCHEDULE == "0 3 * * *" @pytest.mark.parametrize( - "key", ["MAX_CONTENT_LENGTH", "MAX_WEBMENTION_URL_BYTES", "RECEIVED_RETENTION_DAYS"] + "key", + [ + "MAX_CONTENT_LENGTH", + "MAX_WEBMENTION_URL_BYTES", + "RECEIVED_RETENTION_DAYS", + "RECEIVED_MAX_PAGE_SIZE", + ], ) @pytest.mark.parametrize("value", [None, "100", 0, -1, 1.5]) def test_invalid_resource_limits_fail_at_startup( @@ -372,6 +379,18 @@ def test_invalid_resource_limits_fail_at_startup( create_app(InvalidResourceLimit) +def test_received_max_page_size_can_be_set_in_cfg(tmp_path: Path) -> None: + config_file = tmp_path / "development.cfg" + config_file.write_text("RECEIVED_MAX_PAGE_SIZE = 250\n") + + class ConfiguredDevelopment(DevelopmentConfig): + CONFIG_FILE = str(config_file) + LOG_FILE = str(tmp_path / "development.log") + + app = create_app(ConfiguredDevelopment) + assert app.config["RECEIVED_MAX_PAGE_SIZE"] == 250 + + def test_proxy_fix_disabled_by_default(tmp_path: Path) -> None: class DirectConfig(TestingConfig): LOG_FILE = str(tmp_path / "direct.log") -- cgit v1.3.1