Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

complete(handle_rrule=True) fails with ScheduleTagMismatchError, leaving a half-completed recurring task

Aperta
#765 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
Mezza giornata
Idoneità per principianti
50/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python
Ambito
backend

Direzione di ricerca

Start in caldav/calendarobjectresource.py at _complete_recurring_safe (around line 2326), which is reached from complete() (around line 2455). The issue names two candidate fixes: save the recurring task before the completed copy, or delete the copy when the second save fails. Pick one after checking how _post_put and _raise_precondition_failed surface a 412. Done when a mocked 412 on the recurring save leaves no orphaned completed copy.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Disclaimer: AI-generated text below the line, generated by Claude Opus 5.5, from the prompt:

Create an issue to fix this:
(traceback pasted)


Completing a recurring task from plann (plann ... panic → complete) crashed with caldav at v3.4.0-50-g8d7c6c0f:

  File "plann/interactive.py", line 79, in command_edit
    obj.complete(handle_rrule=True)
  File "caldav/calendarobjectresource.py", line 2455, in complete
    return getattr(self, "_complete_recurring_%s" % rrule_mode)(completion_timestamp)
  File "caldav/calendarobjectresource.py", line 2326, in _complete_recurring_safe
    self.save()
  ...
  File "caldav/calendarobjectresource.py", line 1247, in _post_put
    self._raise_precondition_failed(r, headers)
  File "caldav/davobject.py", line 678, in _raise_precondition_failed
    raise error.ScheduleTagMismatchError(errmsg(r))
caldav.lib.error.ScheduleTagMismatchError: ScheduleTagMismatchError at '412 Precondition Failed', reason no reason

One problem, and an explanation:

  1. Non-atomic completion. _complete_recurring_safe first saves the completed copy (completed.save(), succeeded) and then the advanced recurring task (self.save(), failed). The calendar is now left with a completed copy while the recurring task still points at the same occurrence. Retrying the completion creates a second completed copy. Either save the recurring task first (a 412 then leaves nothing behind), or delete the copy when the second save fails.

  2. The 412 itself is correct. Server: Xandikos. Another client changed the task (STATUS, CATEGORIES) between plann's search and the save, which changes Xandikos' Schedule-Tag. Since 45e7bee5 the search caches the tag, so caldav caught this instead of silently overwriting that change. The only bug is (1).

Lingua principale
Python
Stelle
412
Fork
113
Merge medio
1g 6h
PR unite (30g)
35

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di python-caldav/caldav

Tutte le issue di python-caldav/caldav

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.