Repository navigation
Resume a dropped mesh download where it stopped, without counting it as a failed attempt - #1799
Merged
Merged
Conversation
The client now resumes a mesh download that dropped part-way (HTTP Range from the last byte parsed, conditioned on the file's ETag) and does not count such an interruption as a failed attempt. geomfail and georecover carry an rN part when any request of the load was a resume; absent otherwise, so the existing names are unchanged. aN is now every request the load made.
The resume falls back to Last-Modified and Content-Length, which a cross-origin response always lets the page read; on v2-dev the ETag and Content-Range it looked for first were hidden and it started over.
A resume sends Range alone and checks the version of what comes back itself; If-Range made the browser preflight, which the data hosts refuse, so on v2-dev no resume ever got out.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A mesh body that broke off part-way was retried from the top, and after four such drops handed to the server fallback - which fetches the same URL over a worse channel. For a user on a weak or long path (the mobile/continent skew in the GA breakdown) that is the wrong response to an ordinary interruption.
Client
VFBv2.4.5.10:fetchWithRetrycounts two kinds of failure apart. A request that got nowhere (refused, HTTP error, body dead before a new byte) is a strike; four strikes end the call as before. A body that dropped after making progress is not a strike: the download resumes from the last byte parsed withRange: bytes=N-, and the strike count resets.RESUMES(8,window.VFB_FETCH_RESUMES) bounds how many interruptions one call rides out. An HTTP error on a resume keeps the offset.createObjConsumer()keeps the parser and decoder across requests, so a resumed body is more chunks to the same parse. A206is spliced in only if it is the same version of the file (strong ETag where both responses show one, else Last-Modified) and itsContent-Rangestarts exactly at the parse position (or, where that header is hidden, itsContent-Lengthpins the start). A200restarts the parse; any other206is refused. Both silent-corruption cases - a partial body parsed as a whole file, a whole file fed into a half-fed parser - are tested.If-Range: it made the browser preflight withOPTIONS, which the data hosts answer405, so no resume ever left the page. The version check above replaces it.attemptsis now every request the load made;resumesis new alongside it. 16 new tests (61 total).This repo: client pin bumped;
geomfail/georecovercarry:rNwhen any request was a resume (absent otherwise, so existing names are unchanged).Verified on v2-dev against real data hosts: a 9.6 MB mesh cut at 200 KB on
cayenneresumed onbuttermilkwith a206at the right offset and matching ETag, reportedgeorecover:obj:jrchjrcj:a2:r1, and the resulting mesh has exactly the file's vertex and face counts. NeedsAccess-Control-Expose-Headers: ETag, Content-Range, Accept-Rangeson the data hosts for the strong validator (now set in HAProxy); falls back to Last-Modified and Content-Length without it.