fix: authenticate the x.com bootstrap fetch so transaction IDs work again - #85
Closed
nmmanas wants to merge 1 commit into
Closed
fix: authenticate the x.com bootstrap fetch so transaction IDs work again#85nmmanas wants to merge 1 commit into
nmmanas wants to merge 1 commit into
Conversation
…gain _ensure_client_transaction fetched https://x.com without cookies. Logged out, x.com now serves the new "x-web" shell (entry-client-logged-out-*.js), whose HTML carries no `ondemand.s` chunk map — so get_ondemand_file_url() matches nothing, ClientTransaction never initializes, and no request ever carries an x-client-transaction-id. Endpoints that require one (notably SearchTimeline, and the 1.1 auth-verification endpoints) answer 404. Sending the session cookies on that one fetch returns the logged-in responsive-web shell, which still ships the chunk map. Verified against live x.com: `twitter search` returns results, and the log line goes from "Failed to init ClientTransaction: 'NoneType' object has no attribute 'group'" to "ClientTransaction initialized for x-client-transaction-id". The ondemand.s file itself is fetched from the CDN and stays cookie-free. Bootstrap failure remains non-fatal. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Author
|
Closing as a duplicate. Same root cause as #74 / #79 / #71 / #80, and this one takes the root-URL-plus-cookies shape that #71 already explored, so it adds a second change (auth cookies on an HTML bootstrap fetch) that the path-only fix in #74 shows is unnecessary. My verification data is on #74 (#74 (comment)) — it crosses the two variables and confirms either axis alone is sufficient, which points at #74 as the minimal correct fix. No action needed here. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Symptom
twitter search(and anything else hittingSearchTimelineor the 1.1 auth-verification endpoints) returns 404, with this in the log:No request carries an
x-client-transaction-id.Cause
_ensure_client_transactionfetcheshttps://x.comwithout cookies. Logged out, x.com now serves the new "x-web" shell (entry-client-logged-out-*.js), whose HTML carries noondemand.schunk map.get_ondemand_file_url()matches nothing, soClientTransactionnever initializes.Fix
Send the session cookies on that one bootstrap fetch. The logged-in responsive-web shell still ships the chunk map. The
ondemand.sfile itself is fetched from the CDN and stays cookie-free, and bootstrap failure remains non-fatal.Verification
tests/test_client.py— confirmed it fails without the source change (verified by stashing it).ruff checkclean,mypyclean across 18 files.pipx install --force --editable .:twitter search "vibe coding" --from levelsioreturns results;whoami,user-posts,tweet,bookmarksall still work. Log line flips toClientTransaction initialized for x-client-transaction-id.