Repository navigation
fix: authenticate transaction bootstrap and update parser dependency - #99
DavidLiuXh wants to merge 1 commit into
Conversation
|
Independent confirmation on WSL/Linux: the authenticated-homepage change in this PR addresses a reproducible bootstrap failure, rather than an expired-cookie problem. Using the same host, network, curl_cffi session and generated headers, I alternated homepage fetches without/with the existing auth_token and ct0 cookies twice:
I independently applied the equivalent change locally, sending cookies only to the X homepage request and not to the static asset CDN request. After updating xclienttransaction to 1.0.3, transaction initialization succeeded and the warning disappeared. Updating dependencies alone, before applying the homepage-authentication change, did not remove the warning in this environment. Validation of my independent local implementation (not a checkout of this PR):
No tokens or cookie values are included here. I found this PR while preparing to upstream the same fix, so adding confirmation here rather than opening a duplicate. |
|
Independent reproduction on Windows, confirming the diagnosis in this PR (and #93 / #78). Stack:
Two data points that may help pick between the approaches currently in flight:
Also agree with keeping the cookie out of the |
Transaction initialization fetches the X homepage without the user's session cookies. When X serves the logged-out page, the required ondemand script is absent and transaction-ID initialization fails, which can accompany SearchTimeline HTTP 404 errors.
Send the full browser cookie string (or the auth_token/ct0 fallback) when fetching the x.com homepage, while keeping those credentials out of the CDN script request. Check both bootstrap responses for HTTP errors before parsing. Require xclienttransaction >=1.0.3 and update the lockfile so the development environment uses the newer script URL parser as well.
Regression coverage checks both cookie sources, verifies that cookies are not forwarded to the CDN, and confirms successful initialization is cached.
Validation:
uv run pytest -q: 244 passed, 6 smoke tests deselecteduv run ruff check .: passeduv run mypy twitter_cli: passedgit diff --check: passedtwitter search "AI agent" -t Latest --max 5 --jsonon macOS: returned 5 tweets successfully, with no ClientTransaction warning or HTTP 404.Related to #78.