list_files issued a PROPFIND with Depth: infinity. Many WebDAV servers (Nextcloud, ownCloud, Apache mod_dav with infinite depth disabled) reject infinite-depth PROPFIND with HTTP 500 (also 403/501), which surfaced as WebdavError: PROPFIND failed: HTTP 500 and stalled the sync for the affected account.
Fix
When Depth: infinity returns 500/403/501, list_files now falls back to a recursive Depth: 1 traversal of child collections. Relative paths are still computed against the original root URL, so year-folder filtering (webdav_file_matches_min_year) and dedup keys (get_webdav_message_key) keep working for nested files.
Tests
test_parse_propfind_collections_skips_root — child collection parser ignores the root entry.
test_list_files_falls_back_to_depth_one_on_http_500 — infinity returns 500, Depth:1 recursion recovers files from the root and a subfolder; nested file keeps 2025/receipt.pdf relative path and passes year filtering.
test_list_files_still_raises_on_persistent_500 — a 500 that persists through the fallback still surfaces as WebdavError.
All 12 webdav tests pass; collectable suite (27 tests) green.
BIT-33518
Paperclip-Ref: BIT-33518
## Root cause
`list_files` issued a `PROPFIND` with `Depth: infinity`. Many WebDAV servers (Nextcloud, ownCloud, Apache mod_dav with infinite depth disabled) reject infinite-depth PROPFIND with **HTTP 500** (also 403/501), which surfaced as `WebdavError: PROPFIND failed: HTTP 500` and stalled the sync for the affected account.
## Fix
When `Depth: infinity` returns 500/403/501, `list_files` now falls back to a recursive `Depth: 1` traversal of child collections. Relative paths are still computed against the original root URL, so year-folder filtering (`webdav_file_matches_min_year`) and dedup keys (`get_webdav_message_key`) keep working for nested files.
## Tests
- `test_parse_propfind_collections_skips_root` — child collection parser ignores the root entry.
- `test_list_files_falls_back_to_depth_one_on_http_500` — infinity returns 500, Depth:1 recursion recovers files from the root and a subfolder; nested file keeps `2025/receipt.pdf` relative path and passes year filtering.
- `test_list_files_still_raises_on_persistent_500` — a 500 that persists through the fallback still surfaces as `WebdavError`.
All 12 webdav tests pass; collectable suite (27 tests) green.
BIT-33518
Paperclip-Ref: BIT-33518
Some WebDAV servers (Nextcloud, ownCloud, Apache mod_dav with infinite
depth disabled) reject Depth:infinity PROPFIND with HTTP 500/403/501.
list_files now retries with a recursive Depth:1 traversal of child
collections, preserving full relative paths for year-folder filtering
and dedup keys.
BIT-33518
Paperclip-Ref: BIT-33518
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Root cause
list_filesissued aPROPFINDwithDepth: infinity. Many WebDAV servers (Nextcloud, ownCloud, Apache mod_dav with infinite depth disabled) reject infinite-depth PROPFIND with HTTP 500 (also 403/501), which surfaced asWebdavError: PROPFIND failed: HTTP 500and stalled the sync for the affected account.Fix
When
Depth: infinityreturns 500/403/501,list_filesnow falls back to a recursiveDepth: 1traversal of child collections. Relative paths are still computed against the original root URL, so year-folder filtering (webdav_file_matches_min_year) and dedup keys (get_webdav_message_key) keep working for nested files.Tests
test_parse_propfind_collections_skips_root— child collection parser ignores the root entry.test_list_files_falls_back_to_depth_one_on_http_500— infinity returns 500, Depth:1 recursion recovers files from the root and a subfolder; nested file keeps2025/receipt.pdfrelative path and passes year filtering.test_list_files_still_raises_on_persistent_500— a 500 that persists through the fallback still surfaces asWebdavError.All 12 webdav tests pass; collectable suite (27 tests) green.
BIT-33518
Paperclip-Ref: BIT-33518