Skip to content

Conversation

@Nixxx19
Copy link

@Nixxx19 Nixxx19 commented Dec 30, 2025

Fixes #3746

Problem

The downloadProjectAsZip function was calling buildZip without awaiting it, causing a 502 Bad Gateway error when downloading projects. This led to:

  • Unhandled promise rejections if buildZip threw errors
  • No timeout on S3 file fetches, causing requests to hang indefinitely
  • Race conditions when clients disconnected before completion

Changes Made

  • Added await to buildZip call in downloadProjectAsZip to ensure errors are properly caught and the function waits for completion before responding
  • Added 30-second timeout to axios requests when fetching files from S3 to prevent hanging requests
  • Improved error handling by checking res.headersSent before sending error responses to avoid crashes on client disconnects
  • Enhanced error logging with more descriptive error messages for better debugging

Testing

I have verified that this pull request:

  • has no linting errors (npm run lint)
  • has no test errors (npm run test)
  • has no typecheck errors (npm run typecheck)
  • is from a uniquely-named feature branch and is up to date with the develop branch.
  • is descriptively named and links to an issue number, i.e. Fixes #123
  • meets the standards outlined in the accessibility guidelines

@Nixxx19
Copy link
Author

Nixxx19 commented Dec 30, 2025

download.issue.fix.mov

Video Demonstration

I've included a video showing the download functionality working correctly after the fix:

Before the fix: Downloads would hang for ~1 minute and then show a 502 Bad Gateway error
After the fix: Downloads complete successfully and the zip file is generated properly

The video shows:

  • A p5.js sketch being downloaded
  • The download completing successfully
  • The zip file (clock_2025_12_30_16_13_37.zip, 5.2 MB) being saved without errors

This confirms that the changes resolve issue #3746.

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.

Unable to download game

1 participant