From ca25f688c3e9c79b6976ad38aa1e0e65185abb78 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Sun, 14 Jun 2026 12:50:34 -0400 Subject: [PATCH] fix(download): tolerate dl_result without post_record_paths The test_download_service stubs build dl_result as a SimpleNamespace that doesn't set the new field; read it via getattr (matching the existing retry_after_seconds pattern) so phase 3 doesn't AttributeError on stubs or any caller that predates the field. --- backend/app/services/download_service.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/app/services/download_service.py b/backend/app/services/download_service.py index 03df0c3..a913d83 100644 --- a/backend/app/services/download_service.py +++ b/backend/app/services/download_service.py @@ -384,7 +384,7 @@ class DownloadService: # captured so the artist archive is complete. Upsert each (keyed on # external_post_id → updates the same Post a media import would create, # never doubles). No file to clean up; the sidecar stays on disk. - for rec_str in dl_result.post_record_paths or []: + for rec_str in getattr(dl_result, "post_record_paths", None) or []: rec_path = Path(rec_str) if not rec_path.exists(): # noqa: ASYNC240 continue