Skip to content

fix: --all flag now bypasses default count of 20#33

Open
theirongolddev wants to merge 2 commits intoalexknowshtml:mainfrom
theirongolddev:fix/fetch-all-truncation
Open

fix: --all flag now bypasses default count of 20#33
theirongolddev wants to merge 2 commits intoalexknowshtml:mainfrom
theirongolddev:fix/fetch-all-truncation

Conversation

@theirongolddev
Copy link
Copy Markdown
Contributor

@theirongolddev theirongolddev commented Apr 8, 2026

Summary

  • smaug fetch --all passes all: true to fetchAndPrepareBookmarks, but count still defaults to 20
  • fetchBookmarks then correctly truncates the paginated results to the requested count — silently discarding everything past 20
  • Fix: when --all is set, fetchAndPrepareBookmarks now sets count to Infinity so the existing truncation logic in fetchBookmarks passes through the full result set

Test plan

  • Run npx smaug fetch --all with an account that has >20 bookmarks — verify all appear in .state/pending-bookmarks.json
  • Run npx smaug fetch 10 (without --all) — confirm truncation still caps at 10
  • Run npx smaug fetch --all --max-pages 2 — verify page limit is respected

🤖 Generated with Claude Code

fetchBookmarks() truncates results to `count` (default 20) even when
`--all` is explicitly requested. This means `smaug fetch --all` silently
discards everything past the first 20 bookmarks, defeating the purpose
of the flag.

Skip the truncation when `useAll` is true so paginated fetches return
the full result set.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@theirongolddev theirongolddev deleted the fix/fetch-all-truncation branch April 8, 2026 13:53
When `smaug fetch --all` is used, `fetchAndPrepareBookmarks` defaulted
count to 20, causing `fetchBookmarks` to correctly truncate the paginated
results to 20. The --all flag fetched everything but the caller threw
away all but 20.

Set count to Infinity when --all is requested so the existing truncation
logic in fetchBookmarks passes through the full result set.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@theirongolddev theirongolddev reopened this Apr 8, 2026
@theirongolddev theirongolddev changed the title fix: don't truncate results when --all flag is used fix: --all flag now bypasses default count of 20 Apr 8, 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