usnistgov / oar-pdr

The NIST Open Access to Research (OAR) Public Data Repository (PDR) system software
11 stars 10 forks source link

Fix/odd955-956-957 download all failure on mds2-2253, server side error and code clean up #171

Closed chuanlin2018 closed 3 years ago

chuanlin2018 commented 3 years ago

http://mml.nist.gov:8080/browse/ODD-955 http://mml.nist.gov:8080/browse/ODD-956 http://mml.nist.gov:8080/browse/ODD-957

This check in addresses above three tickets. For ODD-955 - Unable to Download-All on mds2-2253, it was caused by Google Analytics script because it takes too long to analyze the datacart page. Fixed this issue by moving GA call to after user confirm downloading. This is logically correct and solved timeing issue.

ODD-956 - server side error: fixed by adding inBrowser flag to non-server-side calls.

ODD-957 - remove dependency on EditStatusService in DataFilesComponent: the service was originally designed for other component but later on the design changed. Used a function call instead of doing a round-trip call. The un-used service was also removed.

Test it in local docker or deploy to oardev.

chuanlin2018 commented 3 years ago

Datacart layout is an easy fix. But I found another bug (also exist in current production): for the case of ark:/88434/mds2-2253, datacart won't be able to update the download status and the zip file names next to the file names because the process was unable to locate the files in the tree. Fixing...

chuanlin2018 commented 3 years ago

Finally, the following fixes are checked in:

  1. The layour of the data tree.
  2. Made the datacart work for param ark:/88434/ediid
  3. Fixed performance issue - removed cart read/write in loops; combined functions to do less loops; etc.
chuanlin2018 commented 3 years ago

Not ready for deploying yet. Fixing another problem...

chuanlin2018 commented 3 years ago

You're welcome! I will revisit other functions sometime to make sure the documentation describes the functions clearly. That helps me as well.

As I said in today's meeting, the last check in the logic that counts the total number of downloaded bundle. It was off by one so the overall download status shows finished while there is still one downloading.

Tried to test it in local docker but some how local deployment took almost one hour. And SDP also took about 30 minutes. Finally I was able to test it in docker. Besides mds2-2253 not available in docker, everything looked good. The number of concurrent downloading bundle is now 3 instead of 2 (the new code counts from 0 to 2 I think).

chuanlin2018 commented 3 years ago

Hope this is the final fix. Tested in local docker. Thanks.

chuanlin2018 commented 3 years ago

Cheers! I tested it a little bit yesterday. Testing more...