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
6 changes: 3 additions & 3 deletions backend/routers/updates.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ def _get_sparkle_zip_download_url(release: Dict, version: str, platform: str) ->
"""
assets = release.get("assets", [])

# Look for the Sparkle ZIP file: {version}-{platform}.zip
expected_filename = f"{version}-{platform}.zip"
# Look for the Sparkle ZIP file: Omi.zip
expected_filename = f"Omi.zip"
Copy link
Contributor

Choose a reason for hiding this comment

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

high

This change hardcodes the expected_filename to "Omi.zip". Consequently, the version and platform parameters passed to _get_sparkle_zip_download_url are no longer used in constructing this filename. This creates a misleading function signature, as it implies these parameters are still relevant for identifying the Sparkle ZIP file. This can lead to confusion and potential future correctness issues if the asset naming convention changes or if developers assume these parameters are actively used. Consider updating the function signature to remove these unused parameters if they are not needed for any other part of the Sparkle ZIP identification logic.


for asset in assets:
asset_name = asset.get("name", "")
Expand All @@ -134,7 +134,7 @@ def _get_sparkle_zip_download_url(release: Dict, version: str, platform: str) ->
# Fallback: look for any zip file that matches the pattern
for asset in assets:
asset_name = asset.get("name", "")
if asset_name.endswith(f"-{platform}.zip"):
if asset_name.endswith(f"Omi.zip"):
Copy link
Contributor

Choose a reason for hiding this comment

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

high

This fallback logic also hardcodes the asset name suffix to "Omi.zip", further confirming that the platform parameter is no longer used in determining the Sparkle ZIP file. This reinforces the concern about the misleading function signature of _get_sparkle_zip_download_url regarding the version and platform parameters.

return asset.get("browser_download_url")

return None
Expand Down