The retry of a failed PUT hides the first answer from the caller

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

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

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
python
領域
api, backend

調査の方向性

Start by tracing _post_put and how it handles failed PUT responses, then read the complete(handle_rrule=True) safe-mode path and the test added during review of PR #845. Compare the first and retry errors, including the vobject ParseError case; done means a failed save preserves enough of the first response for callers to handle possible storage correctly, with tests covering the reported cases.

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

説明

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

Deal with PR #845 [https://github.com/python-caldav/caldav/pull/845; this issue came out of the review of that PR]


_post_put retries a failed PUT once when vobject is installed, a 5xx included. Only the error from the last attempt reaches the caller, so the caller cannot tell that the first attempt may have stored the object.

This matters for complete(handle_rrule=True) in the "safe" mode since https://github.com/python-caldav/caldav/pull/845. It keeps the completed copy after a 5xx on the recurring task, because the task may have been stored. But if the first PUT stores the task and answers 500, and the retry then gets a 412 (the old If-Match no longer matches) or a 403, the error looks like a refusal. The copy is deleted, the completion record is lost and the occurrence is skipped. This was reproduced with a fake client. It only happens with vobject installed, and vobject is only in the test extra.

Also, if the server refuses with e.g. a 403 and get_vobject_instance() then raises a vobject ParseError on data icalendar accepted, that ParseError replaces the server's error.

Possible fixes:

  • Drop the retry on 5xx. The comment says accessing vobject_instance may "clean" the object (https://github.com/python-caldav/caldav/issues/43), but get_vobject_instance() now returns a copy, and the body of the retry was byte-identical in the runs made for the review. This affects every save, so it needs checking.
  • Or raise the error of the first attempt, or carry its status on the error raised.
主要言語
Python
スター
412
フォーク
113
平均マージ
9時間 21分
マージ済み PR(30日)
77

環境構築

はじめの一歩

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

python-caldav/caldav のほかの issue

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

似ている issue

Python の issue をもっと見る

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

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