Repository navigation
tw_caldav_sync: stop re-updating changed tasks on every run - #173
Open
gherardovarando wants to merge 1 commit into
Open
gherardovarando wants to merge 1 commit into
gherardovarando wants to merge 1 commit into
Conversation
Once a task was changed after the first sync, it never compared equal to its counterpart again, so every run updated it, alternating between Taskwarrior and CalDAV: - the x-syncall-tw-waiting flag that convert_tw_to_caldav always sets was dropped by CaldavSide.update_item and never read back by map_ics_to_item; - Taskwarrior's "scheduled" (and the duration UDA) were compared although CalDAV doesn't carry them. Read and write the waiting flag, and compare scheduled/duration only when both items have them. Adds regression tests. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V8Y9HQ5ahrGXsJGEoTmaou
Collaborator
|
Please, use the PR description template. Your agent has overwritten it. Without that compliance, we cannot merge. |
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.
Problem
With
tw_caldav_sync, a task that is changed on either side after the first sync never compares equal to its counterpart again. Every following run updates it, alternating sides (Items updated: 1on Caldav, then on Taskwarrior, and so on). With a Taskwarrior data folder kept in git, that's a commit on every run.Two causes, found with
-vvv(Key [...] exists in one but not in other):x-syncall-tw-waitingis always set byconvert_tw_to_caldav, butCaldavSide.update_itemdrops it (it pops the comparison keys and doesn't write this one back), andmap_ics_to_itemnever reads it.TaskWarriorSide.items_are_identicalcomparesscheduled(and the duration UDA), which CalDAV doesn't carry, so a task with a scheduled date always differs from what comes back.Fix
update_itemand read it inmap_ics_to_item;scheduled/ duration only when both items have them.Regression tests in
tests/test_tw_caldav_stable_sync.py(they fail without the fix);tests/test_tw_caldav_conversions.pystill passes. Tested against a SOGo server: after one settling run, repeated runs report no changes.The priority problems (#151) are separate; there are already PRs for them (#133, #156, #171).
🤖 Generated with Claude Code
https://claude.ai/code/session_01V8Y9HQ5ahrGXsJGEoTmaou