forked from grauschnabel/org-caldav
-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactoring, bugfixes, and unit test for sync-todos #2
Open
jackkamm
wants to merge
22
commits into
whirm:sync-todos
Choose a base branch
from
jackkamm:sync-todos-refactored
base: sync-todos
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
This reverts commit 2d48c55. That commit was buggy and for example breaks unit test org-caldav-01-sync-test, due to the bad line with org-planning-line-re. This reverts the commit, and instead leaves a comment to deal with the deprecated variable later. It is not urgent as org-maybe-keyword-time-regexp is still defined in org-compat.el.
This commit makes org-caldav more robust to recent changes in org-id.el, both in the official Org-mode releases as well as on the Org-mode development branch. Fixes dengste#230. Fixes some of the unit tests (dengste#251). See also: https://list.orgmode.org/87r11un9in.fsf@localhost/T/#t
Reduced code duplication. Made VTODO respect org-caldav-sync-changes-to-org, including when it's "all", so VTODO descriptions can also be updated now.
org-caldav-set-sequence-number tries to delete the existing SEQUENCE, but if it doesn't exist, it will just delete another random line, causing unit test 01 to fail.
In org-caldav-generate-ics, org-export-before-parsing-hook didn't get org-caldav-skip-function properly added to it, because it was bound twice in a let (instead of let*). In org-caldav-skip-function, it was erroring when org-caldav-days-in-past is nil, because of trying to compare a nil value.
I found that fix-todo-priority may sometimes match the PRIORITY from the wrong entry. To prevent this, narrow to the current subtree before searching.
This behavior was accidentally removed during the refactor
This prevents org-id-find from returning the wrong entry in future syncs. Previously, I had mitigated this problem by not visiting the backup file when syncing, however that solution didn't protect against the case where the user manually visits the backup file.
Fix timestamp & ID bugs to make the unit tests work again
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.
This PR refactors the sync-todos branch to bring it closer to upstream, while preserving all new functionality. It also includes several bugfixes, and a unit test for the sync-todo functionality.
Unlike my previous "barebones" branch that I posted in dengste#218, this PR preserves all the functionality in the sync-todos branch (e.g. days-in-past, percent-complete handling). However, it still achieves a substantial reduction in divergence from upstream, by removing whitespace changes, reducing code duplication, and other refactoring:
The PR also merges in my branch which fixes the unit tests and related bugs: dengste#252
Additionally, I added a new unit test for the sync-todos functionality. Also, this PR includes some fixes for bugs I found after I merged the updated the unit tests.
Finally, sync-todo now respects when org-caldav-sync-changes-to-org is "all", which is a consequence of more consistent handling of updates to events and todos.