fix(twitter): tolerate missing findGraphQLQueryId in tweets adapter - #84
Open
zzhan111 wants to merge 1 commit into
Open
fix(twitter): tolerate missing findGraphQLQueryId in tweets adapter#84zzhan111 wants to merge 1 commit into
zzhan111 wants to merge 1 commit into
Conversation
The 5-25 refactor moved findGraphQLQueryId into twitter/_helper.js for reuse. When tweets.js runs in a context where _helper.js was not loaded (e.g. a standalone single-file eval), the bare call throws a ReferenceError before the hardcoded fallback id can be used. Guard the lookup: use findGraphQLQueryId when it is a function, else fall back to the provided hardcoded queryId. Adapter now works both with and without the shared helper present. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
What
Guard the
findGraphQLQueryIdlookups intwitter/tweets.jsso the adaptertolerates the helper not being present.
Why
The 2026-05-25 refactor (
f0cdfbf) extractedfindGraphQLQueryIdintotwitter/_helper.jsfor reuse across the Twitter adapters. That works whenadapters are executed with the helper loaded, but when
tweets.jsruns as astandalone single-file eval (no
_helper.jsin scope), the bare call:throws a
ReferenceErrorbefore the hardcoded fallback id can ever be used —so the adapter dies instead of degrading gracefully.
Change
When the shared helper is present it is used exactly as before; when it is
absent the adapter falls back to the hardcoded query ids. No behavioral change
for the helper-loaded path.
🤖 Generated with Claude Code