Skip to content

Auto-scheduler moves a task but its pushed calendar block stays at the old time #201

Description

@HomicideZero

Describe the bug

When the auto-scheduler re-plans and moves a task that has already been pushed to Google Calendar (the "task block" feature), the task's calendar event is not updated — it stays at the old time. The in-app schedule shows the new time, but the Google Calendar event is stale, so the two disagree until something else dirties the block.

Root cause

The bulk re-plan path writes the task's new slot without marking the block for re-push:

  • SchedulingService.scheduleTask updates scheduledStart/scheduledEnd but never sets blockDirty.
  • repushDirtyBlocks only selects tasks that are blockDirty = true or scheduled-with-blockEventId = null (i.e. brand-new blocks). A task that was moved but already has a blockEventId matches neither, so its event is never updated.

Manual edits and drag-and-drop go through schedulePushTaskBlock and update correctly; only the bulk auto-schedule (scheduleAllTasksForUser) is affected.

Expected behavior

After an auto-schedule run, a moved task's Google Calendar event should move to the task's new time.

Fix

scheduleAllTasksForUser snapshots each task's pre-replan scheduledStart/scheduledEnd, and after scheduling flags blockDirty = true for tasks that have an existing blockEventId and actually moved. The existing repushDirtyBlockspushTaskBlockupdateExistingEvent path then moves the event in place. Unchanged slots are left untouched to avoid needless Calendar API churn.

Verified on a self-hosted instance: re-planning that shifts already-pushed tasks now updates the corresponding Google events in place (same event id, new time) instead of leaving them stale.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions