Fix GraphQL profile responses being ignored due to content type - #329
Merged
Merged
Conversation
Pure code move, no behavior change. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BFDJvmX31k6Xd82sRL7meF
Instagram's GraphQL endpoint (www.instagram.com/graphql/query) responds with "text/javascript; charset=utf-8", not application/json, so the response listener added in #328 discarded the PolarisProfilePageContentQuery response and the bot fell through to the blocked web_profile_info endpoint (429). - Parse GraphQL responses regardless of content type - Accept a user object anywhere in the response, and don't require is_verified - Log diagnostics (GraphQL queries seen, their status/content type, and whether the page HTML contained profile data) when user data cannot be found, so bug reports show where it fails - Add unit tests based on a real PolarisProfilePageContentQuery response Fixes #326 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BFDJvmX31k6Xd82sRL7meF
mifi
force-pushed
the
claude/nifty-mayer-0ihhb3
branch
from
September 14, 2026 20:54
4477d00 to
c0ef30f
Compare
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.
Fixes #326 (follow-up to #328, which shipped in 1.11.15 but still failed with the same 429 error)
Root cause
Instagram's GraphQL endpoint (
www.instagram.com/graphql/query) responds withcontent-type: text/javascript; charset=utf-8, notapplication/json. The response listener added in #328 only parsed responses whose content type contained "json", so thePolarisProfilePageContentQueryresponse carrying the profile data was discarded, and the bot fell through to the blockedweb_profile_infoendpoint. Confirmed from a real captured request/response.Changes
userkey), and don't requireis_verified.Could not get user data for <username> (...).packages/instauto/src/userData.tsand add unit tests based on a realPolarisProfilePageContentQueryresponse (plus the old shape, relay preload cache, streamed responses). The instautotestscript now runs them (node --test); test files are excluded from the build.Testing
tsc,eslint,yarn workspace instauto buildandyarn workspace instauto test(7 tests) pass.🤖 Generated with Claude Code
https://claude.ai/code/session_01BFDJvmX31k6Xd82sRL7meF
Generated by Claude Code