Skip to content

Comments

fix: close zip file handle before saving bundle.zip#357

Merged
najuna-brian merged 2 commits intoOpenDataEnsemble:devfrom
najuna-brian:fix/bundle-zip-save-issue
Feb 25, 2026
Merged

fix: close zip file handle before saving bundle.zip#357
najuna-brian merged 2 commits intoOpenDataEnsemble:devfrom
najuna-brian:fix/bundle-zip-save-issue

Conversation

@najuna-brian
Copy link
Contributor

@najuna-brian najuna-brian commented Feb 25, 2026

Fix: Close zip file handle before saving bundle.zip

Problem

The /app-bundle/download-zip endpoint returns 404 when mobile apps try to download app bundles. The bundle.zip file is not being saved during bundle upload.
Closes #356

Root Cause

In PushBundle, defer zipFile.Close() keeps the zip file handle open when copying the temp file to bundle.zip. The open handle blocks the copy, causing it to fail silently, so bundle.zip is never created.

Solution

  • Removed defer zipFile.Close() at line 42
  • Added explicit zipFile.Close() at line 127, before saving bundle.zip

This ensures the zip file handle is closed before copying, allowing bundle.zip to be saved successfully.

Changes

  • pkg/appbundle/versioning.go: Close zip file handle explicitly before saving bundle.zip

Testing

  • Fix tested locally and confirmed working
  • bundle.zip is now successfully created in version directories
  • Download endpoint works correctly

Impact

  • Severity: High -blocks app bundle updates for all users
  • Affected: All servers running code from Feb 11, 2026 or later
  • Breaking: No -this is a bug fix

@najuna-brian najuna-brian merged commit 8b4fcad into OpenDataEnsemble:dev Feb 25, 2026
9 checks passed
@najuna-brian najuna-brian deleted the fix/bundle-zip-save-issue branch February 25, 2026 14:11
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.

[Synkronus] App Bundle Download Returns 404 Error

2 participants