Skip to content

fix(extension): paginate Twitter bookmark-folder imports past the first page#1269

Open
abhay-codes07 wants to merge 1 commit into
supermemoryai:mainfrom
abhay-codes07:fix/twitter-folder-import-pagination
Open

fix(extension): paginate Twitter bookmark-folder imports past the first page#1269
abhay-codes07 wants to merge 1 commit into
supermemoryai:mainfrom
abhay-codes07:fix/twitter-folder-import-pagination

Conversation

@abhay-codes07

Copy link
Copy Markdown
Contributor

Fixes #1267

What

Importing a Twitter bookmark folder silently capped at the first API page while reporting the truncated count as a complete import. Three related defects in the import path:

  1. the pagination recursion was gated on !this.config.isFolderImport, so folder imports never followed the cursor
  2. buildBookmarkCollectionVariables had no cursor parameter, so even with recursion every request would re-fetch page 1
  3. the folder branch of the URL construction appended &variables=... twice when a cursor was present (the inner ternary already included it, then the outer template appended it again)

Fix

  • buildBookmarkCollectionVariables(bookmarkCollectionId, cursor?) threads the cursor exactly like buildRequestVariables does for the regular flow
  • the recursion guard drops the folder exclusion; termination works the same way as the all-bookmarks flow (the last page yields a cursor but zero tweets, which stops the recursion)
  • the nested URL ternaries collapse into a single baseUrl + variables expression, which removes the double-append path entirely

The 1s inter-page delay and 429 backoff apply to folder pages the same as regular pages.

Testing

  • bun run compile (tsc --noEmit) — clean
  • bun run build (wxt, chrome-mv3) — clean
  • biome check on both touched files — clean

I don't have a Twitter account with a 100+ tweet bookmark folder to drive the full flow end-to-end, so a maintainer with one may want to sanity-check the second page lands; the cursor extraction (extractNextCursor) and tweet parsing (getAllTweets) already handle the folder timeline shape and are unchanged.

cc @MaheshtheDev

…st page

Importing a bookmark folder silently capped at the first API page while
reporting the truncated count as a successful import. Three things
conspired:

- the pagination recursion was gated on !isFolderImport, so folder
  imports never followed the cursor at all
- buildBookmarkCollectionVariables had no cursor parameter, so even if
  the recursion had run, every request would have re-fetched page 1
- the folder branch of the URL construction appended the encoded
  variables twice when a cursor was present (the inner ternary already
  included them, then the outer template added them again)

Thread the cursor through buildBookmarkCollectionVariables, drop the
folder exclusion from the recursion guard (termination is handled the
same way as the regular bookmarks flow: last page yields no tweets),
and collapse the nested URL ternaries into a single base-URL +
variables expression, which removes the double-append path entirely.
Copilot AI review requested due to automatic review settings July 12, 2026 20:17

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@graphite-app graphite-app Bot added the extension related to Supermemory Chrome Extension label Jul 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extension related to Supermemory Chrome Extension

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extension: Twitter bookmark-folder import silently caps at the first page

2 participants