Skip to content

aggregate summary undercounts lists with more than 100 tasks #3

Open

Description

@mattabate

Hi @leefowlercu - gtasks aggregate summary makes a single tasks.list call per list with maxResults: 100 and never follows nextPageToken. Any list with more than 100 tasks is counted as 100, so the total, pending, completed and overdue numbers are all too low. aggregate lists --with-counts has the same single-page read.

plugins/gtasks-todo-manager/skills/gtasks-todo-manager/scripts/commands/aggregate.js:

          for (const list of lists) {
            const tasksResponse = await service.tasks.list({
              tasklist: list.id,
              maxResults: 100,
              showCompleted: true,
            });
            const tasks = tasksResponse.data.items || [];

            accountSummary.tasks += tasks.length;
            summary.totalTasks += tasks.length;

Suggested fix: loop on nextPageToken until it is empty, as fetchAllTasks in tasks.js already does, and use the full array for the counts.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions