nasa / earthdata-download

Download your Earth science data with only one click
https://nasa.github.io/earthdata-download/
Other
22 stars 6 forks source link

EDD-39: Fixes timers when downloads are paused #23

Closed macrouch closed 1 year ago

macrouch commented 1 year ago

Overview

What is the feature?

Adjusts timer logic to be able to show more accurate timers when downloads have been paused and resumed downloading. Added a warning for users when quitting the application that any in-progress files will be lost if they close the application.

What is the Solution?

Added a pauses table to the database. Any time a download or a file is paused/interrupted a new row is created in that table with a timeStart. When the download/file is resumed a timeEnd is added. The sum of those rows is used when calculating the time we want to display in the download/files reports

What areas of the application does this impact?

Downloads:

Testing

Run a download, pause the download and ensure the timers stop incrementing. Resume the download and ensure the timers pick up where they left off, without a large jump in the time displayed

Checklist

codecov[bot] commented 1 year ago

Codecov Report

Merging #23 (573cfc7) into main (eeb5d88) will increase coverage by 0.31%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main      #23      +/-   ##
==========================================
+ Coverage   92.04%   92.36%   +0.31%     
==========================================
  Files          94       96       +2     
  Lines        1735     1807      +72     
  Branches      400      402       +2     
==========================================
+ Hits         1597     1669      +72     
  Misses        138      138              
Files Changed Coverage Δ
src/app/components/DownloadItem/DownloadItem.jsx 92.00% <ø> (ø)
.../DownloadListItem/DownloadListItemFileProgress.jsx 100.00% <ø> (ø)
...ponents/FileListItem/FileListItemTimeRemaining.jsx 100.00% <ø> (ø)
src/main/eventHandlers/beginDownload.ts 100.00% <ø> (ø)
...rc/main/eventHandlers/willDownloadEvents/onDone.ts 100.00% <ø> (ø)
...onents/FileDownloadsHeader/FileDownloadsHeader.jsx 97.82% <100.00%> (ø)
src/main/eventHandlers/beforeQuit.ts 100.00% <100.00%> (ø)
src/main/eventHandlers/didFinishLoad.ts 100.00% <100.00%> (ø)
src/main/eventHandlers/pauseDownloadItem.ts 100.00% <100.00%> (ø)
src/main/eventHandlers/requestDownloadsProgress.ts 92.59% <100.00%> (-0.52%) :arrow_down:
... and 8 more