The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
test(matrix): make the 502 SVG fixture actually embed "403"
kshitijk4poor257288ede10b
diff --git a/plugins/platforms/matrix/adapter.py b/plugins/platforms/matrix/adapter.pyindex 30cdc1822af..e5e67666591 100644--- a/plugins/platforms/matrix/adapter.py+++ b/plugins/platforms/matrix/adapter.py@@ -209,7 +209,7 @@ def _is_permanent_matrix_auth_error(exc: BaseException) -> bool:A transient homeserver outage surfaces as a 5xx whose body may be an HTMLerror page (Umbrel's app-proxy returns one). Naive substring checks like``"403" in str(exc)`` false-positive on digits embedded in that HTML (an SVG- coordinate such as ``40.4302`` contains ``403``) or in the ``since`` token+ path coordinate such as ``1403.2`` contains ``403``) or in the ``since`` tokenechoed by a timeout message, which stopped the sync loop permanently on apassing blip. mautrix raises ``MatrixRequestError`` with ``errcode`` and``http_status`` for every non-2xx, so classify on those alone; anythingdiff --git a/tests/gateway/test_matrix.py b/tests/gateway/test_matrix.pyindex aba2eca206c..ec5b392f3a5 100644--- a/tests/gateway/test_matrix.py+++ b/tests/gateway/test_matrix.py@@ -1375,9 +1375,9 @@ class TestMatrixSyncLoop:@pytest.mark.parametrize("exc",[- # Umbrel app-proxy 502: the SVG coordinate 40.4302 embeds "403".+ # Umbrel app-proxy 502: an SVG path coordinate embeds "403"._sync_error.__func__(- '502: <!DOCTYPE html><svg><path d="M17.4517 40.4302C12.7214 40.4302"/></svg>',+ '502: <!DOCTYPE html><svg><path d="M17.4517 1403.2C12.7214 1403.2"/></svg>',http_status=502,),# Plain timeout echoing the pagination token, which embeds "401".