Skip to content

Refresh expired Etebase tokens during sync - #368

Open
besendorf wants to merge 1 commit into
etesync:masterfrom
besendorf:fix/refresh-expired-etebase-token
Open

besendorf wants to merge 1 commit into
etesync:masterfrom
besendorf:fix/refresh-expired-etebase-token

Conversation

@besendorf

Copy link
Copy Markdown

Summary

  • refresh an expired Etebase authentication token from the saved account session
  • persist the renewed session and retry the failed sync once
  • leave legacy EteSync sessions and unrelated Etebase errors unchanged
  • add regression tests for token renewal, retry behavior, and error classification

Rationale

When the Etebase server rejects an expired persisted authentication token, the sync thread currently logs Invalid token. and retries later with the same invalid session. Etebase retains the account key needed to fetch a fresh token, so the DAV bridge can recover without deleting and re-adding the user.

The refreshed account session is saved before retrying, so the replacement token also survives a restart. The retry is limited to the exact Invalid token. error and happens only once; errors such as Invalid stoken. continue to propagate normally.

Fixes #341.

Testing

  • python -m unittest -v tests.test_token_refresh
  • ruff check .
  • ruff format --check .
  • check-manifest -v
  • python setup.py --fullname
  • python setup.py --description
  • python setup.py --long-description

@besendorf besendorf mentioned this pull request Sep 1, 2026
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.

Error invalid token

1 participant