Skip to content

fix: auto-scroll gives up too early on large bookmark libraries#86

Open
JinZhongcun wants to merge 1 commit into
viperrcrypto:mainfrom
JinZhongcun:fix/autoscroll-premature-stop
Open

fix: auto-scroll gives up too early on large bookmark libraries#86
JinZhongcun wants to merge 1 commit into
viperrcrypto:mainfrom
JinZhongcun:fix/autoscroll-premature-stop

Conversation

@JinZhongcun

Copy link
Copy Markdown

Summary

Auto-scroll stops after ~9 seconds without new items (8 stagnant cycles + one 2s recheck). X's timeline regularly pauses loading for longer than that (rate limiting, slow fetches), so exports of large libraries stop far before the end. On an ~8,000-bookmark account, the current logic captured only 1,961 items (~25%) before declaring completion.

Changes

  • Wait through stalls for up to ~45s before declaring completion (both BOOKMARKLET_SCRIPT and CONSOLE_SCRIPT in app/import/page.tsx)
  • Every ~10 stagnant cycles, nudge the timeline (scroll up ~2600px, then back down) to retrigger X's infinite loading
  • Final recheck wait extended from 2s to 5s

Related Issues

None

Checklist

  • Tested locally — on the same ~8,000-bookmark account, the old logic stopped at 1,961 items; with this change auto-scroll recovered from multiple multi-second stalls and exported all ~7,800 bookmarks down to 2015
  • npx tsc --noEmit — no new errors introduced (the 2 pre-existing errors in app/api/import/x-oauth/fetch/route.ts are present on main as well)
  • No new warnings

Auto-scroll stops after ~9 seconds without new items (8 stagnant
cycles + one 2s recheck). X's timeline regularly pauses loading for
longer than that (rate limiting, slow fetches), so exports of large
libraries stop far before the end: on an ~8,000-bookmark account the
current logic captured only 1,961 items (~25%).

Wait through stalls for up to ~45s, and every ~10 stagnant cycles
nudge the timeline (scroll up, then back down) to retrigger loading.
With this change the same account exported all ~7,800 bookmarks, with
auto-scroll recovering from multiple multi-second stalls.
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