feat: Apple Reminders two-way sync with calendarItemIdentifier storage#6161
Draft
feat: Apple Reminders two-way sync with calendarItemIdentifier storage#6161
Conversation
Add apple_reminder_id to UpdateActionItemRequest and ActionItemResponse models for storing EventKit calendarItemIdentifier. Add new GET /v1/action-items/pending-sync endpoint that returns items needing outbound sync (unexported) and inbound sync (have apple_reminder_id).
Add get_unexported_action_items() for finding items needing outbound sync and get_action_items_with_reminder_id() for finding items needing inbound completion sync.
- addReminder now returns calendarItemIdentifier instead of bool
- syncBatchFromJSON returns [{actionItemId, calendarItemIdentifier}]
- Fix calendar source to use defaultCalendarForNewReminders (iCloud)
- Remove UserDefaults 100-item dedup cap
- Add getRemindersStatus for batch identifier lookup
- Add updateReminder for updating by identifier
- Add deleteReminder for deleting by identifier
Update handleAppleRemindersSync to send calendarItemIdentifier mappings instead of plain action item IDs via markExportedBatch.
Store the EventKit calendarItemIdentifier on the action item model for two-way Apple Reminders sync.
Add appleReminderId parameter to updateActionItem for storing the EventKit identifier. Add getPendingSyncItems() for fetching items that need outbound or inbound Apple Reminders sync.
- addReminder returns calendarItemIdentifier string instead of bool - Update FCM/background sync handlers for new mapping format - Add getRemindersStatus for batch identifier lookup - Add updateReminderById and deleteReminderById methods
Update _handleAppleRemindersExport to capture and store the calendarItemIdentifier when manually exporting to Apple Reminders.
New orchestrator that runs on foreground resume with 30s debounce: - Outbound: creates reminders for unexported items, stores identifiers - Inbound: detects completion changes in Apple Reminders, syncs back
Add lifecycle hook in HomePage to run AppleRemindersSyncService on app resume, then refresh action items UI after sync completes.
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.
Summary
calendarItemIdentifier— Every Apple Reminder we create now returns its stable EventKit UUID, which is stored on the backend alongside the action item. This enables lookup, update, delete, and completion detection.AppleRemindersSyncServiceruns on every app foreground (30s debounce). Fetches unexported items from backend, creates reminders locally, stores identifiers back. No longer solely dependent on FCM silent push (which iOS throttles to ~2-3/hour).addRemindernow usesdefaultCalendarForNewReminders()instead of preferring.localsource, so reminders sync across devices via iCloud.UserDefaultsdedup mechanism replaced by backend identifier mapping.Changes
Backend (2 files)
apple_reminder_idfield onUpdateActionItemRequestandActionItemResponseGET /v1/action-items/pending-sync?platform=apple_remindersendpointiOS Native (2 files)
addReminderreturnscalendarItemIdentifierstring instead oftrue/falsesyncBatchFromJSONreturns[{actionItemId, calendarItemIdentifier}]mappingsgetRemindersStatus,updateReminder,deleteReminderDart (6 files modified, 1 new)
appleReminderIdfield onActionItemWithMetadataAppleRemindersServicewith new return types and methodsAppleRemindersSyncServiceorchestrator (outbound + inbound sync)AppLifecycleState.resumedinHomePageTest plan
🤖 Generated with Claude Code