You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(api): restore search after x.com renamed the transaction id middleware header - #2755
/2/search answers {"code":404,"results":[]} again for every query, on api.fxtwitter.com and on self-hosted instances alike (same symptom as #2303). Each request logs Error generating transaction ID: Error: Couldn't get on-demand file index before any GraphQL call is made; on our self-hosted instance the first occurrence was on 2026-11-20.
The hashed-chunk lookup from #2701 still finds the right module, but it keys on the x-botox-client-transaction-id string, and x.com no longer ships it. On the logged-out page fetched on 2026-11-21, the entry (entry-client-logged-out-BfJ4Z7Ze.js) statically imports four modules and none of them contains the old name. The middleware module (assets/CitZFE1G.js) now registers x-client-transaction-id and still lazy-loads the generator via import(`./ohfgT4dS.js`).then(e=>e.default()). The generator chunk itself is unchanged and parses to key-byte indices 10,36,4,24.
Solution
Match client-transaction-id, which covers both the old and the new header name. Another statically imported module also mentions x-client-transaction-id without the lazy generator import (as DFhr1Vbc.js already does in the saved fixtures); the existing if (!chunk) continue skips it. The JSDoc is updated to match.
Tests
New case in test/clientTransaction.test.ts: the saved middleware fixture with x-botox-client-transaction-id renamed to x-client-transaction-id. It is served under a fresh entry and chunk name, because cachedFetch would otherwise return the copy cached by the happy-path test. Without the change it fails with Couldn't get on-demand file index; with it the indices 0,13,31,41 are extracted.
npx vitest run: 72 files, 479 tests passed. npx prettier --check and npx eslint --max-warnings=0 pass on both changed files.
Live: against the current logged-out x.com, ClientTransaction.create() plus generateTransactionId('GET', '/i/api/graphql/abc/SearchTimeline') throws on main and returns an id with this change. A self-hosted instance running 0f08128 with this change applied serves /2/search results again.
Summary by CodeRabbit
Bug Fixes
Transaction initialization now works with both the legacy and current transaction header names, including on logged-out x.com pages.
The current header is recognized when transaction indices are extracted, preserving expected behavior across renamed middleware modules.
…ing the generator chunk
x.com no longer ships the `x-botox-client-transaction-id` string: the middleware
module the logged-out entry statically imports now registers
`x-client-transaction-id`. The hashed-chunk scan keyed on the old name, found no
module, and ClientTransaction init threw "Couldn't get on-demand file index", so
/2/search answered 404. Match `client-transaction-id`, which covers both names;
modules that only mention the header without the lazy generator import are still
skipped by the existing `if (!chunk) continue`.
Review was skipped as selected files did not have any reviewable changes.
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 1dc4bcdd-68df-48fc-af34-3ca86ee9ae57
Commits
Reviewing files that changed from the base of the PR and between 52572a5 and def27c9.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
The transaction middleware scan now recognizes modules with either x-botox-client-transaction-id or x-client-transaction-id. A test verifies that ClientTransaction.create() extracts indices when the newer header name is present.
The middleware scan matches the shared client-transaction-id text. The test checks that initialization extracts indices 0,13,31,41 when the newer header name is used.
This restores transaction ID generation after the upstream header rename, so /2/search should work again. The change is small and reversible, and no merge-blocking risk was found.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title names the main change: restoring search after x.com renamed the transaction id middleware header. The changeset matches both the old x-botox-client-transaction-id and the new x-client-transa…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the main change: restoring search after x.com renamed the transaction id middleware header. The changeset matches both the old x-botox-client-transaction-id and the new x-client-transaction-id header names in indicesFromXWebSign, updates its JSDoc, and adds a regression test for the renamed layout. The title uses the conventional fix(api) prefix and is specific enough for a teammate scanning history. The title is 81 characters, which is slightly longer than ideal but still readable.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
A rabbit checks the header line Both names now pass the scan just fine The indices appear in place A test confirms the newer case Then hops away at a steady pace
Recent review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: ee759064-95ff-42b7-82df-f6c87c724f0f
Commits
Reviewing files that changed from the base of the PR and between 44ae3f2 and 240a34c.
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
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
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.
Problem
/2/searchanswers{"code":404,"results":[]}again for every query, on api.fxtwitter.com and on self-hosted instances alike (same symptom as #2303). Each request logsError generating transaction ID: Error: Couldn't get on-demand file indexbefore any GraphQL call is made; on our self-hosted instance the first occurrence was on 2026-11-20.The hashed-chunk lookup from #2701 still finds the right module, but it keys on the
x-botox-client-transaction-idstring, and x.com no longer ships it. On the logged-out page fetched on 2026-11-21, the entry (entry-client-logged-out-BfJ4Z7Ze.js) statically imports four modules and none of them contains the old name. The middleware module (assets/CitZFE1G.js) now registersx-client-transaction-idand still lazy-loads the generator viaimport(`./ohfgT4dS.js`).then(e=>e.default()). The generator chunk itself is unchanged and parses to key-byte indices10,36,4,24.Solution
Match
client-transaction-id, which covers both the old and the new header name. Another statically imported module also mentionsx-client-transaction-idwithout the lazy generator import (asDFhr1Vbc.jsalready does in the saved fixtures); the existingif (!chunk) continueskips it. The JSDoc is updated to match.Tests
test/clientTransaction.test.ts: the saved middleware fixture withx-botox-client-transaction-idrenamed tox-client-transaction-id. It is served under a fresh entry and chunk name, becausecachedFetchwould otherwise return the copy cached by the happy-path test. Without the change it fails withCouldn't get on-demand file index; with it the indices0,13,31,41are extracted.npx vitest run: 72 files, 479 tests passed.npx prettier --checkandnpx eslint --max-warnings=0pass on both changed files.ClientTransaction.create()plusgenerateTransactionId('GET', '/i/api/graphql/abc/SearchTimeline')throws onmainand returns an id with this change. A self-hosted instance running 0f08128 with this change applied serves/2/searchresults again.Summary by CodeRabbit