Repository navigation
fix: [Timetraked] Paginate archived task fetch past the 1000-row cap - #274
Merged
Merged
Conversation
getArchivedDays loaded all archived tasks in one query, which PostgREST truncates at 1000 rows. Once the tasks table passed that, the newest archived days rendered with no tasks. Page through with a stable (start_time, id) order, and add regression tests. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GhvAYaQY83fW4raUET9yj5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Archived days were rendering with no tasks even though the tasks existed in Supabase.
SupabaseService.getArchivedDaysloaded every archived task in a single unpaginated query, and PostgREST caps a response at 1000 rows. Thetaskstable has 1,029 rows, so the newest ~29 tasks (roughly Oct 5 to Oct 15) were silently dropped, and every archived day containing them showed an empty task list. Not specific to mobile; it is the day you just archived that is most likely to be affected.Type of Change
Related Issue
None.
Changes Made
src/services/supabaseService.ts:getArchivedDaysnow pages throughtaskswith.range()in 1000-row pages, ordered bystart_timethenidso pages are deterministic, and stops on the first short page. Added a typedTaskRowinterface andTASKS_PAGE_SIZEconstant.src/services/supabaseService.test.ts: addedrangeto the mock builder and two regression tests (multi-page fetch returns all 1029 tasks; single request when the first page is not full). Both fail without the fix.AGENTS.md: test inventory row updated for the new coverage.Checklist
Documentation
README.mdCHANGELOG.mdupdated accordinglyCHANGELOG.mdis generated by the release workflowGeneral
mainpnpm test,pnpm lint, andpnpm buildNotes for Reviewers
Verified against the live project: no tasks are mis-flagged
is_current, and recent archived days have correctly linked task rows, so the data was intact and only the read was truncated. Separately, several archived days have no task rows at all (Oct 6, Oct 7, a duplicate Oct 1 record, and a few from May and June). Those are not caused by this bug and are not addressed here.Tested in authenticated mode only via unit tests with a mocked Supabase client; guest mode (localStorage) is unaffected by this change.
🤖 Generated with Claude Code
https://claude.ai/code/session_01GhvAYaQY83fW4raUET9yj5
Generated by Claude Code