Issue with downloading single files directly from a study within the AD portal
Thank you , the fix has been pushed to production.
I tested the individual file. I got the right one
, I have applied a fix on staging and verified the correct file can be downloaded directly from the study details page. Could you please also double check on staging? Thank you.
This issue is readily reproducible by going to the next page of results in the Metadata table, and then trying to use the direct file download.
We currently have a FileEntityHandleQueryWrapper, which is being called a few times on page change. This is where the race condition exists. If it’s old results return last (which happens often in the case of loading the last page of results, since there are fewer rows), then the DirectDownload components are all configured based on the preview page of results. I don’t really understand what benefit the FileEntityHandleQueryWrapper provides us today. I think it was introduced with the hopes that we could have multiple components rely on the same "FileFetchResponse”, but today only the DirectDownload component uses it.
Recommend we simplify for today, and change the DirectDownload to ask for the "FileFetchResponse” (which I think is what initially implemented, before I asked for an optimization for the HasAccess and DirectDownload to use the same results!).