Cannot download differentially, fallback to full download: Error: Content-Type "multipart/byteranges" is expected
See original GitHub issue- Version: 22.3.6
- Electron Version: 7.1.2
- Electron Type (current, beta, nightly): current
- Electron-Updater: 4.2.0
(Not the newest versions, but the code in question hasn’t changed since.)
- Target: Windows
Electron-Updater’s multipleRangeDownloader expects a Content-Type: multipart/byteranges; boundary=aaaaaaaaaaaa
header when it decides whether the server supports multiple downloads or not. However, if there is just ONE chunk of download, the server would respond with Content-Type: x-something/random
and Content-Range: bytes 1111-2222
, properly indicating a single-chunk partial - and that’s something multipleRangeDownloader doesn’t recognize as valid, resulting in a fallback to a full download in a possibly very favorable, small, single-chunk update situation.
Proper behavior would be to check (just in case) if Content-Range
is a single chunk, and then allow the partial download.
One could set useMultipleRangeRequest
to false to circumvent the problem, but it would negate the benefit of a multipart download in non-single-chunk cases.
I suspect inventing a boundary string and adding a proper byteranges wrapper to incoming data, then feeding it to DataSplitter (multipleRangeDownloader.ts:104
), would do the trick, but I don’t have the means to build a proper test at the moment.
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (4 by maintainers)
Top GitHub Comments
Sorry, I was not describing this as a good first issue for you specifically. I labeled it because I thought it’d be a good first issue for any new person that is looking to contribute 🙂
I didn’t mean to sound entitled, as for points 1 and 3, I wasn’t insisting that you go and fix this now, I was just genuinely surprised issues are (commonly on GH, seeing as the StaleBot is a rather standard fixture) so readily allowed to be closed out of inaction. It’s completely off topic, of course, but I just wonder why not keep such issues open - for a long time, maybe. Who knows, maybe you or some new contributor would eventually take it up, for lack of better things to do? Is there some sort of anathema on projects having many old issues, open since forever and still causing problems every once in a while, but minor enough not to have sparked interest?
On Sat, 24 Jul 2021 at 17:11, Mike Maietta @.***> wrote:
– Adam “Sinus” Skawiński