Skip to content

Conversation

@odysseus0
Copy link
Contributor

@odysseus0 odysseus0 commented Feb 1, 2026

Summary

Simplifies query ID management from two-tier caching (static JSON + runtime cache) to single-tier (runtime cache only).

Before:

  • Static query-ids.json shipped with the package as fallback
  • Runtime cache fetched fresh IDs and stored them
  • getQueryId() returned cached value or fell back to static JSON

After:

  • No static fallbacks - fresh IDs fetched on first use
  • getQueryId() returns cached value or empty string
  • Empty query ID causes API 404 → triggers refresh → retry (existing flow handles it)

Changes

  • Remove src/lib/query-ids.json and scripts/update-query-ids.ts
  • Define TARGET_QUERY_ID_OPERATIONS as explicit const array in constants
  • Simplify all client mixins to use centralized getQueryId()
  • Remove graphql:update npm script
  • Update refresh() to accept readonly string[]

Why

  • Simpler architecture (475 fewer lines of code)
  • No stale static fallbacks that could cause issues
  • Single source of truth for query IDs (runtime cache)
  • First-run warmup fetches fresh IDs automatically

Test plan

  • pnpm build passes
  • All 417 tests pass
  • Lint passes
  • Manual test: rm ~/.config/bird/query-ids-cache.json && bird search "hello" -n 1 - fresh IDs fetched and cached successfully

🤖 Generated with Claude Code

odysseus0 and others added 2 commits February 1, 2026 09:13
- Add ADDITIONAL_FALLBACK_QUERY_IDS in twitter-client-constants.ts for
  operations that need multiple fallback IDs
- Add UserByScreenName to FALLBACK_QUERY_IDS (was missing)
- Add getQueryIdList() helper in twitter-client-base.ts that combines
  runtime cache, fallback ID, and additional fallbacks
- Update all mixin files to use getQueryIdList() instead of hardcoded arrays
- Reduces duplication and makes query ID management easier

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove two-tier caching (static JSON + runtime) in favor of single-tier
(runtime cache only). Fresh IDs are fetched on first use; 404 errors
trigger automatic refresh and retry.

Changes:
- Remove static query-ids.json and update-query-ids.ts script
- Define TARGET_QUERY_ID_OPERATIONS as explicit const array
- Simplify all client mixins to use centralized getQueryId()
- Update refresh function to accept readonly string[]
- Remove graphql:update npm script

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@odysseus0 odysseus0 changed the title refactor: consolidate fallback query IDs into centralized constants refactor: simplify query ID architecture to runtime-only cache Feb 1, 2026
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