-
Notifications
You must be signed in to change notification settings - Fork 553
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
Downloading .exe causes network failure/incomplete file error message in the browser #316
Comments
Problem is related to the data type of the size field in asset table. More info on the problem: hasura/graphql-engine#5092 It needs to be float8 and not float4, once changed to float8 the problem is gone. |
Thanks for the ticket and your investigation! |
Was your Postgres table created manually or by sails? |
I started the docker containers using docker-compose and the tables were created automatically. |
Thanks, I'll make a change to ensure that the correct precision is used. This shouldn't be a floating point field anyway |
Thank you! Same for the download_count field. |
WaterlineJS defaults to using floating point field types for number fields. The causes precision issues for file sizes since the reported file sizes do not match the assets. This would also prevent the download count tracking to work once the count is high enough such that one download is beyond the supported precision. Note: users must update their existing database schemas to avoid these issues.
I'm using Docker and It seems that the Content-Length: header is larger than the actual file size.
Uploaded file: 05fda7a3-93ca-4303-afde-d114d2448859.exe
also if I log https://github.com/ArekSredzki/electron-release-server/blob/master/api/services/AssetService.js#L29 it shows 96881700
Could that be some sort of a rounding happening somewhere?
The above problem is causing the download to fail if accessed over https, or restart if accessed over http.
Workaround that fixes the problem, is to comment out this line:
res.setHeader('Content-Length', asset.size);
UPDATE: Same problem when downloading the update System.Exception: Checksummed file size doesn't match, so it must be something to do with rounding.
The text was updated successfully, but these errors were encountered: