Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ dependencies = [
"highdicom>=0.26.1,<1; python_version < '3.14'", # transitive dependency pyjpegls not yet supporting Python 3.14
"html-sanitizer>=2.6.0,<3",
"httpx>=0.28.1,<1",
"idc-index-data==23.0.3",
"idc-index-data==23.2.7",
Copy link

Choose a reason for hiding this comment

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

Bug: A failure to download an index file from a GitHub release is not handled with an exception, leading to a runtime error when the None attribute is accessed later.
Severity: CRITICAL

🔍 Detailed Analysis

The fetch_index() method in idc_index.py downloads additional index files, such as sm_instance_index.parquet, from GitHub release assets. If a file is missing from the release, the method logs an error but does not raise an exception. This causes the corresponding attribute, like client.sm_instance_index, to remain None. Subsequent code in _service.py that attempts to use this attribute to download individual DICOM instances will fail with an error, such as an AttributeError. This silent failure during the download process leads to a runtime crash when a core feature is used.

💡 Suggested Fix

Modify the fetch_index() method in idc_index.py to raise an exception if the requests.get() call fails to download an index file (e.g., status code is not 200). This will ensure the failure is caught immediately, rather than silently propagating a None value that causes a downstream crash.

🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: pyproject.toml#L103

Potential issue: The `fetch_index()` method in `idc_index.py` downloads additional index
files, such as `sm_instance_index.parquet`, from GitHub release assets. If a file is
missing from the release, the method logs an error but does not raise an exception. This
causes the corresponding attribute, like `client.sm_instance_index`, to remain `None`.
Subsequent code in `_service.py` that attempts to use this attribute to download
individual DICOM instances will fail with an error, such as an `AttributeError`. This
silent failure during the download process leads to a runtime crash when a core feature
is used.

Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID: 8388379

"ijson>=3.4.0.post0,<4",
"jsf>=0.11.2,<1",
"jsonschema[format-nongpl]>=4.25.1,<5",
Expand Down
Loading