I am trying to troubleshoot why I cannot get changes to Task titles, and dates, from google tasks, based on the query param updatedMin
:
In the following scenarios, all Changes made to tasks are done in Google Tasks flyout via calendar.google.com or done via the Android Tasks app.
Fail Scenarios
Fail Scenario 1:
I have a Task A in google Tasks with the Title of "foo"
I have a datetime called
lastSync
=2022-04-04T04:24:02.773Z
I then change a Task A's title to "bar" at
2022-04-04T04:25:12.773Z
- minute and 10 seconds greater thanlastSync
I then do the following query:
import { google, tasks_v1 } from "googleapis";
const taskClient = google.tasks({ version: "v1", auth: oauth2Client });
if (list.updated) {
const updated = GoogleTaskClient.dateFromRfc339(list.updated);
if (updated > lastSync) {
const res = await taskClient.tasks.list({
tasklist: list.id,
updatedMin: formatRFC3339(lastSync),
showHidden: true,
showDeleted: true,
showCompleted: true,
maxResults: 100,
});
}
- and the response has Zero items.
Fail Scenario 2:
I have a Task A in google Tasks with the Title of "foo"
I have a datetime called
lastSync
=2022-04-04T04:24:02.773Z
I then change Task A's date at
2022-04-04T04:25:12.773Z
- minute and 10 seconds greater thanlastSync
run the query
and the response has Zero items.
Success scenarios
Success Scenario 1:
I have a Task A in google Tasks with the Title of "foo"
I have a datetime called
lastSync
=2022-04-04T04:24:02.773Z
I then mark Task A as complete at
2022-04-04T04:25:12.773Z
- minute and 10 seconds greater thanlastSync
run the query
and the response includes Task A.
Success Scenario 2:
I have a Task A in google Tasks with the Title of "foo"
I have a datetime called
lastSync
=2022-04-04T04:24:02.773Z
I then change a Task A's title to "bar" at
2022-04-04T04:25:12.773Z
- minute and 10 seconds greater thanlastSync
I then change Task A's date at
2022-04-04T04:25:15.773Z
run the query
and the response has Task A with the changes.
Summary
Changing the status of a Task always results in it being returned by the query, but changes to Date and Title don't appear to work with updatedMin
.
Is this a known limitation of the task API - if so can you help me with some references.
I realized my error/ didn't mention this part ♂️...
I was only getting tasks from TaskLists that were
updated
after thelastSync
:The
TaskList
object from the API has anupdated
prop - string: Last modification time of the task list (as a RFC 3339 timestamp).My error comes from thinking that changing the title of a Task or its time would result in a change to the
updated
prop of the parent List, but only changing the status of a task, or deleting a task does that or so it appears (I think it changes when order changes as well). Changes to Title, Description, Time, only cause the respective Task'supdate
prop to be updated.The docs could clarify that what qualifies as a update to a TaskList: https://developers.google.com/tasks/reference/rest/v1/tasklists#TaskList