fix(auth): resolve V2 API 429 rate limit during authentication - #34
fix(auth): resolve V2 API 429 rate limit during authentication#34mattpetters wants to merge 1 commit into
Conversation
The V2 API signon endpoint now requires additional headers to avoid 429 rate limiting at the AWS ELB level: - Add Origin: https://ticktick.com header - Add Referer: https://ticktick.com/ header - Update X-Device header to use full web app format (os, device, channel, etc.) The version number in X-Device is NOT strictly validated - the original 6430 works fine. The key fix is the Origin/Referer headers and the full X-Device structure. Fixes dev-mirzabicer#33
3c63359 to
23f4ab5
Compare
- Add Origin: https://ticktick.com header - Add Referer: https://ticktick.com/ header - Update X-Device header to web app format with full device info - Update User-Agent to Chrome 120.0 Fixes upstream issue dev-mirzabicer#33, based on PR dev-mirzabicer#34 by mattpetters
- auth.py & client.py: Mimic real browser headers (Chrome UA, Origin, Referer, full x-device) to avoid TickTick's AWS ELB rate limiting. Ref: dev-mirzabicer#34 - task.py: Add field_validator for repeat_from to handle string/empty values from TickTick API (e.g. "0", "1", ""). Ref: dev-mirzabicer#29 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Thanks for this fix — verified working here (Windows 11, ticktick-sdk 0.4.3 installed via pipx, used as an MCP server): sign-on went 429 → 200 with these headers. One heads-up from testing: after applying only this patch, The root cause is that request headers are built in two independent places, and this PR only covers the auth one:
Locally I extended the same treatment to the data path (Chrome User-Agent + Would you consider extending this PR to cover |
Summary
Fixes #33 - V2 API returns 429 rate limit during
client.connect()after fresh OAuth flow.Root Cause
TickTick added rate limiting at their AWS ELB level that blocks requests missing proper browser headers. The SDK's minimal header approach was being flagged as bot traffic.
Changes
Origin: https://ticktick.comheader (required)Referer: https://ticktick.com/header (required)X-Deviceheader to match web app format with full device info6430to8010Investigation
Headers were identified by:
Testing
Verified fix works with: