Skip to content

fix: update stale fallback query IDs - #75

Open
yonran wants to merge 1 commit into
tfriedel:mainfrom
yonran:fix/stale-query-ids
Open

fix: update stale fallback query IDs#75
yonran wants to merge 1 commit into
tfriedel:mainfrom
yonran:fix/stale-query-ids

Conversation

@yonran

@yonran yonran commented Jun 26, 2026

Copy link
Copy Markdown

Summary

  • HomeLatestTimeline query ID had rotated; the stale ID causes 422 GRAPHQL_VALIDATION_FAILED on every home feed request
  • Scraped fresh IDs from Twitter JS bundles and updated the fallback table

Test plan

  • Run tweethoarder sync feed — should succeed (no 422)
  • Or run tweethoarder refresh-ids to pull the latest IDs from live bundles

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Updated a fallback identifier used for loading the Home Latest timeline, which may improve timeline availability when the primary request fails.

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.
@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The fallback GraphQL query ID for HomeLatestTimeline was updated in the exported query ID mapping.

Changes

Fallback query ID update

Layer / File(s) Summary
HomeLatestTimeline fallback value
src/tweethoarder/query_ids/constants.py
FALLBACK_QUERY_IDS["HomeLatestTimeline"] now points to a different query ID string.

Estimated review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: refreshing stale fallback query IDs.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/tweethoarder/query_ids/constants.py (1)

20-34: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add module docstring and consider fallback lists per bird reference pattern.

The FALLBACK_QUERY_IDS mapping 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

📥 Commits

Reviewing files that changed from the base of the PR and between 77d0018 and a55a155.

📒 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 updated HomeLatestTimeline query ID follows the same base64url encoding and length conventions as neighboring entries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant