Repository navigation
fix(progress): name the collection and count pages per request - #177
Conversation
The progress line printed the endpoint (daily_sleep for sleep, sleep for sleep-periods), a third vocabulary next to the summary's collection and table names, and its page counter reset only when the endpoint changed, so a range split into 30-day requests ran one counter across all of them. The client now numbers pages per request and both callers map the endpoint to its collection. Closes #129 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018qh9xqviBHYmzVtmQWSKqA
[Low impact] The PR appears safe to merge, with the previously reported terminal display issue remaining as a non-blocking concern. Findings
SummaryThe PR makes terminal progress use collection names and restart page counts for each request.
The previous-review merge bases differ, so this review checked the full PR diff. Reviews (2) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile |
| onPage(page) { | ||
| if (page.endpoint !== endpoint) { endpoint = page.endpoint; pages = 0; rows = 0; } | ||
| pages++; | ||
| pages = page.page; |
There was a problem hiding this comment.
Restarting the page counter can leave old text on the terminal. When one request ends at page 10 and the next starts at page 1, with the row total still the same width, the new line is one character shorter. show() writes only a carriage return before the text, so the previous trailing character remains visible. Clear the line or pad shorter frames before writing them.
# Conflicts: # CHANGELOG.md
Closes #129.
Planned together with #131. The two turned out unrelated (the progress line versus a note under
db rows), so #131 has its own PR.What
syncing sleepfor thedaily_sleependpoint,syncing sleep-periodsforsleep, and so on.collectionOfinrun-command.tsmaps an endpoint to its collection, and both the sync runner andfetchpass it topageProgress.fetch()call (PageEvent.page), and the progress line shows that number. A range split into 30-day pieces counts each piece's own pages, and the row count still runs across them.Why
Reproduced on main: the new fetch test shows
fetching heartrate: page 1 … page 6for three 30-day pieces of two pages each. The sync progress test showssyncing daily_sleep, which is the endpoint of thesleepcollection.Left as is: the issue also notes that the last frame repeats the previous row total when the final page is empty. That frame reports a page that really arrived with 0 rows, so I did not change it.
How checked
src/commands/fetch.test.ts:fetchCollectionfor hr over 61 days, through a realOuraClientwith a stubbedfetch. It checks all six frames (fetching hr: page 1, 2 rows so far…throughpage 2, 9 rows so far…). The sync terminal-progress test now expectssyncing sleepandsyncing sleep-periods. Both fail on main's sources. The existing progress and client tests now carry thepagefield.src/commands/fetch.test.ts:pages = page.page;→pages++;inprogress.ts: 1 of 17 fails (the new test).bun run check: typecheck, Biome, Knip clean; 712 tests pass.Overlap:
src/commands/run-command.tsis also changed by #173 (different lines).🤖 Generated with Claude Code
https://claude.ai/code/session_018qh9xqviBHYmzVtmQWSKqA