Fix Google Calendar event recurrence on task creation#1539
Merged
callumalpass merged 1 commit intocallumalpass:mainfrom Feb 8, 2026
Merged
Conversation
…dar event correctly
Owner
|
Thanks very much for this PR, @christenbc! Really appreciate it. I'll merge this and include the changes in the next release. |
callumalpass
added a commit
that referenced
this pull request
Feb 8, 2026
The mock function signature was incorrect - it accepted a string but the actual function accepts a TaskInfo object. Updated the mock to match the real function signature and adjusted the test expectation to expect the DTSTART prefix in the recurrence output. This fixes the test broken by #1539 which added DTSTART to recurrence rules during task creation.
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.
Fix: Add DTSTART to recurrence rules during task creation
Problem
When creating a task with recurrence, the recurrence field was set without
DTSTART(e.g.,FREQ=DAILY;INTERVAL=3). This caused Google Calendar sync to fail on initial creation because theconvertToGoogleRecurrence()function requiresDTSTARTto properly convert the recurrence rule.However, when editing that same task, the system would automatically add
DTSTART(e.g.,DTSTART:20260128T093000Z;FREQ=DAILY;INTERVAL=30), which then allowed Google Calendar sync to work correctly.Root Cause
During Task Creation: The recurrence field was set directly from the modal/form without
DTSTART:TaskCreationModal.buildTaskData()passed recurrence directly withoutDTSTARTTaskService.applyTaskCreationDefaults()created simple FREQ rules withoutDTSTARTDuring Task Editing:
TaskService.updateTask()automatically addedDTSTARTto recurrence rules that didn't have one by callingaddDTSTARTToRecurrenceRule()in three scenarios:Google Calendar Sync: The
convertToGoogleRecurrence()function requiresDTSTARTto be present in the recurrence rule. Without it, the conversion returnsnulland Google Calendar events are not created with recurrence.Solution
Added logic in
TaskService.createTask()to automatically addDTSTARTto recurrence rules during task creation, ensuring consistency between creation and editing flows.Changes
File:
src/services/TaskService.tscompleteTaskDataobject to detect recurrence rules withoutDTSTARTaddDTSTARTToRecurrenceRule()to addDTSTARTusing the task's scheduled date (ordateCreatedas fallback)Code Location
Impact
Benefits
✅ Consistent behavior: Tasks with recurrence now have
DTSTARTfrom creation, matching the behavior after editing✅ Google Calendar sync works immediately: The
convertToGoogleRecurrence()function can now properly parse the recurrence rule on first sync✅ No breaking changes: Existing logic in
updateTask()serves as a safety net for any edge cases✅ Backward compatible: Existing tasks without
DTSTARTwill still work correctly (the edit flow adds it)Testing Recommendations
Create a new task with recurrence:
FREQ=DAILY;INTERVAL=3recurrenceDTSTART(e.g.,DTSTART:20260128T093000Z;FREQ=DAILY;INTERVAL=3)Verify existing behavior:
DTSTARTis addedEdge cases:
dateCreated)Related