Skip to content

Conversation

@danesfeder
Copy link
Contributor

Closes #1741

This PR adds a NetworkProgressListener that will allow us to get progress of a TAR (or any) API request.

This is currently blocked upstream by the TAR download API not returning content-length, so we aren't able to do the math for current progress of the download. Once the lands, we will also need to add Interceptor support for the MapboxRouteTiles so we can add the interceptor itself for the network request.

TODO:

  • Add unit tests
  • Bring in new MAS dependency with Interceptor support
  • Confirm content-length is being provided

cc @kevinkreiser @akitchen

@danesfeder danesfeder force-pushed the dan-network-listener branch from 1a2c8c6 to f4da5f5 Compare April 23, 2019 19:36
@codecov-io
Copy link

codecov-io commented Apr 23, 2019

Codecov Report

Merging #1753 into master will decrease coverage by 0.08%.
The diff coverage is 0%.

@@             Coverage Diff              @@
##             master    #1753      +/-   ##
============================================
- Coverage     35.04%   34.96%   -0.09%     
  Complexity     1060     1060              
============================================
  Files           261      263       +2     
  Lines          8848     8870      +22     
  Branches        667      669       +2     
============================================
  Hits           3101     3101              
- Misses         5475     5497      +22     
  Partials        272      272

}

@Override
public Response intercept(@NonNull Chain chain) throws IOException {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we care about RequestBody#contentLength()?

private BufferedSource bufferedSource;

NetworkResponseBody(ResponseBody responseBody, NetworkProgressListener listener) {
this.responseBody = responseBody;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

responseBody can be null here..

@akitchen akitchen removed this from the v0.37.0 milestone May 1, 2019
@Guardiola31337
Copy link
Contributor

#1741 was closed as Offline feature is being re-implemented. Let's make sure the new version includes support for this.

cc @zugaldia @korshaknn

@etl etl deleted the dan-network-listener branch April 22, 2021 10:48
@etl etl restored the dan-network-listener branch April 22, 2021 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

⚠️ DO NOT MERGE PR should not be merged!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RouteTileDownloadListener#onProgressUpdate gives progress for TAR extraction not download

5 participants