fix: update stale fallback query IDs - #75
Conversation
HomeLatestTimeline ID had rotated; stale ID causes 422 GRAPHQL_VALIDATION_FAILED on every home feed request. Updated to current ID scraped from Twitter JS bundles.
📝 WalkthroughWalkthroughThe fallback GraphQL query ID for ChangesFallback query ID update
Estimated review effort🎯 1 (Trivial) | ⏱️ ~2 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/tweethoarder/query_ids/constants.py (1)
20-34: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd module docstring and consider fallback lists per bird reference pattern.
The
FALLBACK_QUERY_IDSmapping lacks a Google-style module docstring. As per coding guidelines, Google style docstrings are required for all Python code.More significantly, the bird reference implementation specifies that "query IDs should have fallback lists for resilience." Currently each operation maps to a single string rather than a prioritized list of IDs. This undermines the fallback intent—if the primary ID rotates, there is no secondary ID to try. Consider migrating to
dict[str, list[str]]with fallback ordering.As per coding guidelines, "query IDs should have fallback lists for resilience; Type hints required for all code; Use Google style for docstrings".
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/tweethoarder/query_ids/constants.py` around lines 20 - 34, Add a Google-style module docstring for the constants module and update FALLBACK_QUERY_IDS to use prioritized fallback lists instead of single strings. The issue is that each operation currently stores only one query ID, so locate the FALLBACK_QUERY_IDS mapping and change its type hint and values to a list-based structure with fallback ordering, preserving the existing identifiers as the primary entries and adding secondary ones where available. Ensure the updated type annotations remain explicit and consistent with the module-level constants style used in this file.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/tweethoarder/query_ids/constants.py`:
- Around line 20-34: Add a Google-style module docstring for the constants
module and update FALLBACK_QUERY_IDS to use prioritized fallback lists instead
of single strings. The issue is that each operation currently stores only one
query ID, so locate the FALLBACK_QUERY_IDS mapping and change its type hint and
values to a list-based structure with fallback ordering, preserving the existing
identifiers as the primary entries and adding secondary ones where available.
Ensure the updated type annotations remain explicit and consistent with the
module-level constants style used in this file.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: ab2fab9a-000e-4845-8efc-6c99d9a2e6df
📒 Files selected for processing (1)
src/tweethoarder/query_ids/constants.py
📜 Review details
🧰 Additional context used
📓 Path-based instructions (1)
**/*.py
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.py: Port Twitter API patterns from bird reference implementation: headers must include x-twitter-auth-type: OAuth2Session, x-twitter-active-user: yes, x-twitter-client-language: en; feature flags need ~40 entries; query IDs should have fallback lists for resilience
Type hints required for all code
Use Google style for docstrings
**/*.py: Type hints required for all code
Use Google style for docstrings
Files:
src/tweethoarder/query_ids/constants.py
🔇 Additional comments (1)
src/tweethoarder/query_ids/constants.py (1)
31-31: LGTM! The updatedHomeLatestTimelinequery ID follows the same base64url encoding and length conventions as neighboring entries.
Summary
HomeLatestTimelinequery ID had rotated; the stale ID causes 422GRAPHQL_VALIDATION_FAILEDon every home feed requestTest plan
tweethoarder sync feed— should succeed (no 422)tweethoarder refresh-idsto pull the latest IDs from live bundles🤖 Generated with Claude Code
Summary by CodeRabbit