Skip to content

[ROMM-2247] Return early if cover write fails #2249

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 10, 2025
Merged

[ROMM-2247] Return early if cover write fails #2249

merged 1 commit into from
Aug 10, 2025

Conversation

gantoine
Copy link
Member

Description
Explain the changes or enhancements you are proposing with this pull request.

Fixes #2247

Checklist
Please check all that apply.

  • I've tested the changes locally
  • I've updated relevant comments
  • I've assigned reviewers for this PR
  • I've added unit tests that cover the changes

Screenshots

@gantoine gantoine requested a review from Copilot August 10, 2025 18:51
@gantoine gantoine self-assigned this Aug 10, 2025
Copy link

trunk-io bot commented Aug 10, 2025

Running Code Quality on PRs by uploading data to Trunk will soon be removed. You can still run checks on your PRs using trunk-action - see the migration guide for more information.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Fixes an issue where cover image fetch failures were not properly handled by adding an early return when cover write operations fail due to transport errors.

  • Adds early return (return None) when cover fetch fails due to httpx.TransportError

@@ -75,6 +75,7 @@ async def _store_cover(
await f.write(chunk)
except httpx.TransportError as exc:
log.error(f"Unable to fetch cover at {url_cover}: {str(exc)}")
return None
Copy link
Preview

Copilot AI Aug 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The early return only handles httpx.TransportError but the function may continue executing and potentially fail in other ways after a transport error. Consider if other cleanup or error handling is needed before returning, or if the function should handle other potential exceptions that could occur during the cover writing process.

Copilot uses AI. Check for mistakes.

Copy link

Test Results

548 tests  ±0   547 ✅ ±0   57s ⏱️ -1s
  1 suites ±0     1 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 4728e5d. ± Comparison against base commit 40e824d.

Copy link

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
8749 6167 70% 0% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
backend/handler/filesystem/resources_handler.py 70% 🟢
TOTAL 70% 🟢

updated for commit: 4728e5d by action🐍

@gantoine gantoine merged commit c135847 into master Aug 10, 2025
9 checks passed
@gantoine gantoine deleted the romm-2247 branch August 10, 2025 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Scan fails with FileNotFoundError when ScreenScraper cover fetch fails
1 participant