Skip to content
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

indeterminate progress #1286

Open
jeromectm opened this issue Sep 7, 2018 · 6 comments
Open

indeterminate progress #1286

jeromectm opened this issue Sep 7, 2018 · 6 comments

Comments

@jeromectm
Copy link

jeromectm commented Sep 7, 2018

Since version 1.19, the download progress is indeterminate (and the progress strings shows something like "[current] MB of [current] MB", instead of "[current] MB of [total] MB". The HTTP server from which I download probably does not return the size, but the appcast does, and it was working before version 1.19.
Here is my appcast:
https://services.ctmdev.com/cgi-bin/sparkle?appcast=FTProfessional_appcast

<?xml version="1.0" encoding="utf-8"?> <rss version="2.0" xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle" xmlns:dc="http://purl.org/dc/elements/1.1/"> <channel> <title>FoxTrot Release Notes</title> <description>Most recent changes with links to updates.</description> <language>en</language> <item> <title>Version 6.5.2</title> <sparkle:releaseNotesLink>https://services.ctmdev.com/VersionChecking/FoxTrot/FTProfessionalReleaseNotes.html</sparkle:releaseNotesLink> <enclosure sparkle:version="6.5.2" sparkle:minimumSystemVersion="10.9" url="http://powermail.simplenet.com/FTProfessional6.5.2.tbz" length="7563321" type="application/octet-stream" sparkle:dsaSignature="MCwCFEuO5jPsxjTKoDJMeOXIA7DoWdCDAhRDO+tReuSk0q2f4yO+gt5WRvQz7A==" /> </item> </channel> </rss>

@kornelski
Copy link
Member

Yeah, we've rewritten the download code recently (to remove deprecated APIs). It's likely that we're depending on HTTP now rather than appcast info.

It'd be ideal if you emitted Content-Type header from your cgi-bin.

@nightbirdsevolve
Copy link

@kornelski Same issue here, progress is indeterminate even tho server sends a Content-Length header… what can we do to make it work?

@kornelski
Copy link
Member

Investigate the downloader code — maybe it's not reading the header from the response.

@nightbirdsevolve
Copy link

For what it's worth: disabling apache gzip solved my indeterminate progress issue. But still could be nice of Sparkle to fallback to the length attribute. I'll investigate later :)

@moubry
Copy link

moubry commented Jul 24, 2019

For anyone stumbling across this in the future, I was having the issue of an indeterminate progress indicator appearing. Simply adding the Content-Length HTTP header to the app ZIP file’s download/response fixed the issue. So Sparkle definitely uses the Content-Length HTTP header to know how big the download is going to be.

Here's a relevant subset of the HTTP response headers I'm sending:

...
Content-Type: application/zip
Content-Length: 49884791
Content-Disposition: attachment; filename="MyApp_0.2.1.zip"
Content-Transfer-Encoding: binary
...

^ Simply adding Content-Length to these other headers is what fixed it. I have other headers besides this, but these are the ones that seemed most relevant to this issue.

Re: what @nightbirdsevolve mentioned, my web server is not gzipping the response either.

@zorgiepoo
Copy link
Member

I think we're supposed to fall back to length in appcast item if reported http header length is 0. But if the reported length from http server is wrong, we don't try to fix it (though we emit a console warning). Might be worth re-investigating what the logic actually is.

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

No branches or pull requests

5 participants