Skip to content

fix: install XHR interceptor after navigation to prevent context reset#91

Merged
jackwener merged 1 commit intojackwener:mainfrom
Astro-Han:worktree-fix-twitter-search
Mar 19, 2026
Merged

fix: install XHR interceptor after navigation to prevent context reset#91
jackwener merged 1 commit intojackwener:mainfrom
Astro-Han:worktree-fix-twitter-search

Conversation

@Astro-Han
Copy link
Contributor

@Astro-Han Astro-Han commented Mar 19, 2026

Summary

Closes #79
Closes #86
Closes #87

Test plan

  • TypeScript type check passes
  • All 186 unit tests pass
  • Manual test: opencli twitter search "test" --limit 5 returns results
  • Manual test: opencli twitter notifications --limit 5 returns results

goto() triggers a full page navigation that resets the JS execution
context, wiping any previously injected fetch/XHR monkey-patches.
The old code installed the interceptor on x.com then navigated away,
so the interceptor was always destroyed before it could capture data.

Fix: navigate directly to the target page, install interceptor after
page load, then scroll to trigger API calls via pagination.

Also fixes the same bug in notifications.ts.

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

Labels

None yet

Projects

None yet

2 participants