Skip to content

fix(matrix): stop retry loop on token introspection auth errors - #921

Open
hashbender wants to merge 1 commit into
mainfrom
mirror/pr-57150
Open

fix(matrix): stop retry loop on token introspection auth errors#921
hashbender wants to merge 1 commit into
mainfrom
mirror/pr-57150

Conversation

@hashbender

Copy link
Copy Markdown
Owner

What does this PR do?

Fixes the Matrix sync loop so mautrix token introspection failures are treated as permanent auth errors instead of transient sync errors retried forever.

The adapter already stopped on 401/403/unauthorized/forbidden and unknown-token responses; this adds the observed Unable to introspect the access token failure mode to the same classification and shares that classification between returned sync error objects and thrown exceptions.

Related Issue

Fixes NousResearch#56532

Type of Change

  • Bug fix
  • Tests
  • New feature
  • Documentation
  • Refactor

Changes

  • Adds a small Matrix permanent-auth marker helper.
  • Classifies Unable to introspect the access token as a permanent auth condition.
  • Keeps transient sync exceptions retryable.
  • Adds a regression test that verifies the introspection failure stops after one sync attempt.

How to Test

  • .venv/bin/python -m pip install aiohttp (local test dependency needed by existing Mattermost tests in the same file)
  • .venv/bin/python -m pytest tests/gateway/test_ws_auth_retry.py -q
  • .venv/bin/python -m ruff check plugins/platforms/matrix/adapter.py tests/gateway/test_ws_auth_retry.py
  • scripts/run_tests.sh tests/gateway/test_ws_auth_retry.py -q
  • pytest tests/ -q

Platform: macOS, Python 3.13, local .venv.


Mirror-of: NousResearch#57150
NousResearch#57150

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]:[Matrix] Gateway enters permanent sync retry loop after "Unable to introspect the access token" although token remains valid

1 participant