DIYgod / RSSHub

🧡 Everything is RSSible
https://docs.rsshub.app
MIT License
33.57k stars 7.51k forks source link

Reduce Twitter token lock time from 24h to 1h for better service recovery #17580

Open AiraNadih opened 7 hours ago

AiraNadih commented 7 hours ago

Routes

/twitter/home/:routeParams?

Full routes

/twitter/home/onlyMedia=1

Related documentation

https://docs.rsshub.app/routes/social-media#x-twitter

What is expected?

When a Twitter token becomes invalid and login retry fails, the token should be locked for a reasonable time period (e.g., 1 hour).

What is actually happening?

Currently, when a token becomes invalid (403/401 response) and login retry fails, the code locks the token for 86400 seconds (24 hours). This is unnecessarily long and could cause extended service disruption even after the credentials are fixed.

Relevant code:

https://github.com/DIYgod/RSSHub/blob/091ed089301b942b916807f081e2316a9d04c125/lib/routes/twitter/api/web-api/utils.ts#L206

Deployment information

Self-hosted

Deployment information (for self-hosted)

No response

Additional info

Suggested changes:
1. Reduce the lock time from 86400 (24 hours) to 3600 (1 hour)
2. This shorter duration would:
   - Allow faster recovery after credential fixes
   - Improve service availability

This is not a duplicated issue

github-actions[bot] commented 7 hours ago
Searching for maintainers:

To maintainers: if you are not willing to be disturbed, list your username in scripts/workflow/test-issue/call-maintainer.js. In this way, your username will be wrapped in an inline code block when tagged so you will not be notified.

If all routes can not be found, the issue will be closed automatically. Please use NOROUTE for a route-irrelevant issue or leave a comment if it is a mistake. 如果所有路由都无法匹配,issue 将会被自动关闭。如果 issue 和路由无关,请使用 NOROUTE 关键词,或者留下评论。我们会重新审核。

github-actions[bot] commented 7 hours ago
Searching for maintainers:

To maintainers: if you are not willing to be disturbed, list your username in scripts/workflow/test-issue/call-maintainer.js. In this way, your username will be wrapped in an inline code block when tagged so you will not be notified.

If all routes can not be found, the issue will be closed automatically. Please use NOROUTE for a route-irrelevant issue or leave a comment if it is a mistake. 如果所有路由都无法匹配,issue 将会被自动关闭。如果 issue 和路由无关,请使用 NOROUTE 关键词,或者留下评论。我们会重新审核。