Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Completing a fixed-time recurring task before its DTSTART does not advance it

オープン
#782 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
55/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
backend

調査の方向性

Start with Todo._next() and Todo.complete(handle_rrule=True) in the caldav package, then check _complete_recurring_thisandfuture, which passes the same completion_timestamp. Run the snippet from the issue to reproduce: completing a fixed-time RRULE task (BYMONTH) before its DTSTART returns the current occurrence instead of the next one. Done means the early-completion call advances to the next occurrence after DTSTART, and the after-DTSTART case still behaves as before.

索引モデルが issue の本文から書いたものです。

説明

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


Todo.complete(handle_rrule=True) moves a recurring task to self._next(completion_timestamp). For an RRULE with BY* parts ("fixed-time" recurrence), _next() keeps the original DTSTART and returns rrule.after(completion_timestamp). When the task is completed before its DTSTART, that is the current occurrence itself, so the task stays where it was. In "safe" mode a completed copy is written, and the recurring task still shows the occurrence that was just done.

from datetime import datetime, timezone
from caldav import Todo
t = Todo(data="""BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//x//y//EN
BEGIN:VTODO
UID:t1
DTSTAMP:20261016T120000Z
DTSTART:20270404T093000Z
DUE:20270404T123000Z
RRULE:FREQ=YEARLY;BYMONTH=4,9
SUMMARY:first layer
END:VTODO
END:VCALENDAR""")
t._next(datetime(2027, 4, 2, 10, tzinfo=timezone.utc))  # done two days early
# -> 2027-04-04 09:30 UTC, the same occurrence (expected 2027-09-04)
t._next(datetime(2027, 4, 4, 12, tzinfo=timezone.utc))  # done after DTSTART
# -> 2027-09-04 09:30 UTC, as expected

Suggested fix: for fixed-time recurrences, look for the next occurrence after max(completion_timestamp, DTSTART) (strictly after the current DTSTART). _complete_recurring_thisandfuture passes ts=completion_timestamp as well, and should probably get the same treatment.

主要言語
Python
スター
412
フォーク
113
平均マージ
22時間 43分
マージ済み PR(30日)
43

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

python-caldav/caldav のほかの issue

python-caldav/caldav の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。