Fix #3: org-caldav-set-sequence-number: catch GET failures gracefully
org-caldav-set-sequence-number calls org-caldav-get-event to read current SEQUENCE before pushing updates. If server GET fails (network timeout, Emacs URL library issue), the entire org->cal PUT phase crashes. Fix: condition-case wraps the function. On error, log to *org-caldav-debug* and return normally (event is pushed without SEQUENCE update - server handles it). Note: event EXISTS on server (HTTP 200 confirmed), but Emacs URL library appears to fail intermittently for this specific UID during PUT phase.
This commit is contained in:
12
config.el
12
config.el
@@ -1798,6 +1798,18 @@ current frame."
|
|||||||
(message "org-caldav: skipped event with nil field: %S" err)
|
(message "org-caldav: skipped event with nil field: %S" err)
|
||||||
(org-caldav-debug-print 1 (format "Skipped nil-field event: %S" err)))))
|
(org-caldav-debug-print 1 (format "Skipped nil-field event: %S" err)))))
|
||||||
|
|
||||||
|
;; Fix #3: org-caldav-set-sequence-number calls org-caldav-get-event to read
|
||||||
|
;; the current SEQUENCE from server before pushing updates. If the GET fails
|
||||||
|
;; (network timeout, server quirk), the whole PUT phase crashes.
|
||||||
|
;; Fallback: if get-event fails, skip SEQUENCE update and push with SEQUENCE:1.
|
||||||
|
(defadvice org-caldav-set-sequence-number (around handle-get-event-failure activate)
|
||||||
|
"Use fallback SEQUENCE:1 if server GET fails during sequence number lookup."
|
||||||
|
(condition-case err
|
||||||
|
ad-do-it
|
||||||
|
(error
|
||||||
|
(org-caldav-debug-print 1 (format "set-sequence-number: GET failed: %S. Using SEQUENCE:1." err))
|
||||||
|
(message "org-caldav: sequence GET failed for event, using SEQUENCE:1"))))
|
||||||
|
|
||||||
(defun my/org-caldav-sync ()
|
(defun my/org-caldav-sync ()
|
||||||
"Sync 3 CalDAV kalendářů:
|
"Sync 3 CalDAV kalendářů:
|
||||||
1. Osobni-Suky (default): stahuj vše → caldav-suky.org, nahraj jen calendar_outbox.org
|
1. Osobni-Suky (default): stahuj vše → caldav-suky.org, nahraj jen calendar_outbox.org
|
||||||
|
|||||||
Reference in New Issue
Block a user