Skip to content

fix: [Timetraked] Paginate archived task fetch past the 1000-row cap - #274

Merged
AdamJ merged 1 commit into
mainfrom
fix/archived-tasks-pagination
Oct 16, 2026
Merged

AdamJ merged 1 commit into
mainfrom
fix/archived-tasks-pagination

Conversation

@AdamJ

@AdamJ AdamJ commented Oct 16, 2026

Copy link
Copy Markdown
Owner

Summary

Archived days were rendering with no tasks even though the tasks existed in Supabase. SupabaseService.getArchivedDays loaded every archived task in a single unpaginated query, and PostgREST caps a response at 1000 rows. The tasks table 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

  • New feature
  • Update to existing feature
  • Bug fix
  • Documentation update
  • Other (describe below)

Related Issue

None.

Changes Made

  • src/services/supabaseService.ts: getArchivedDays now pages through tasks with .range() in 1000-row pages, ordered by start_time then id so pages are deterministic, and stops on the first short page. Added a typed TaskRow interface and TASKS_PAGE_SIZE constant.
  • src/services/supabaseService.test.ts: added range to 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

  • Any notable changes added to the README.md
  • CHANGELOG.md updated accordingly
  • N/A — no README changes; CHANGELOG.md is generated by the release workflow

General

  • Branch is up to date with main
  • No unrelated files included in this PR
  • Tested locally by invoking the pnpm test, pnpm lint, and pnpm build

Notes 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

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
@github-actions github-actions Bot added automation For items related to release/documentation/workflow automations frontend labels Oct 16, 2026
@AdamJ AdamJ self-assigned this Oct 16, 2026
@AdamJ AdamJ added this to Timetraked Oct 16, 2026
@github-project-automation github-project-automation Bot moved this to Backlog in Timetraked Oct 16, 2026
@AdamJ AdamJ moved this from Backlog to In review in Timetraked Oct 16, 2026
@AdamJ
AdamJ merged commit e1adc53 into main Oct 16, 2026
3 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in Timetraked Oct 16, 2026
@AdamJ
AdamJ deleted the fix/archived-tasks-pagination branch October 16, 2026 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation For items related to release/documentation/workflow automations frontend

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants