Conversation
| curFileInfoIdx++; | ||
| try { | ||
| zippedBytes += zipHandler.addZipEntry(zout, fi); | ||
| zippedBytes += zipHandler.addZipEntry(zout, fi, curFileInfoIdx); |
There was a problem hiding this comment.
I'll remove this argument, was testing something, not needed anymore.
loitly
left a comment
There was a problem hiding this comment.
Please make the suggested code cleanup before merging.
| String suggestedFilename = URLDownload.getSugestedFileName(uc); | ||
|
|
||
| //fallback to filename from URL path if content-disposition header is missing | ||
| if (isEmpty(suggestedFilename)) { | ||
| String urlPath = url.getPath(); |
There was a problem hiding this comment.
This new block of code is confusing, likely due to hasFileNameResolver, which is no longer used. It was removed, but the cleanup was incomplete. With that in mind, the updated code should now look like this:
String extName = ofNullable(fi.getExternalName()).orElse("").trim();
if (extName.isEmpty() || extName.endsWith("/")) {
String suggestedFilename = URLDownload.getSugestedFileName(uc);
suggestedFilename = isEmpty(suggestedFilename) ? getFileNameFromUrl(filename) : suggestedFilename;
fi.setExternalName(extName + suggestedFilename);
}
Move the logic for getFileNameFromUrl() into a separate method.
| //strip surrounding quotes, if any | ||
| suggestedFilename = suggestedFilename.replaceAll("^\"|\"$", ""); |
There was a problem hiding this comment.
These logic should only apply when getFileNameFromUrl. But, it's not enough. I would also sanitize it to remove illegal characters in file path/name.
A quick and dirty way is to do this:
suggestedFilename.replaceAll("[^a-zA-Z0-9._-]", "_"); // all chars not in this set will be converted to '_'
| boolean isDatalink = (access_format != null && access_format.contains(DATALINK)) || | ||
| (access_format == null && datalinkServDesc != null); |
There was a problem hiding this comment.
This simplifies to : datalinkServDesc != null || access_format != null && access_format.contains(DATALINK).
Is that the logic you intended?
There was a problem hiding this comment.
Yes, I suppose that would work as well. The second condition there datalinkServDesc != null is essentially checking for non-obscore tables containing datalink (like mer-catalog in Euclid, for instance). So I'll make the change to simplify this.
457fa02 to
7d8d611
Compare
| if (extName.isEmpty() || extName.endsWith("/")) { | ||
| String suggestedFilename = URLDownload.getSugestedFileName(uc); | ||
| suggestedFilename = isEmpty(suggestedFilename) ? getFileNameFromUrl(url) : suggestedFilename; | ||
| suggestedFilename = suggestedFilename.replaceAll("[^a-zA-Z0-9._-]", "_"); |
There was a problem hiding this comment.
Move this line into getFileNameFromUrl().
There was a problem hiding this comment.
done, addressed the other changes as well. Rebuilding the test builds to make sure no new bugs were introduced.
There was a problem hiding this comment.
Testing CADC
- I tried to do cutout only and I did not get anything even though I could do a cutout.
- When I ask for the whole file I got filename surrounded by quotes.

Testing DCE
- Mostly looks good
- The first row is not package.
- the first row is not packaged
- if I choose the first three rows I just get two products
- If I choose the second and third rows I get the same two products.
7156aed to
70ef4e1
Compare
|
| const tbl_id = getActiveTableId(); | ||
| const tblTitle = getTblById(tbl_id)?.title ?? 'unknown'; | ||
| export const PrepareDownload = React.memo(({table_id, tbl_title, viewerId, showFileStructure=false, | ||
| downloadType='package', dataSource, fileName}) => { |
There was a problem hiding this comment.
The dialog should show a working message until the fetchSemanticList completes. In Euclid on the first download the list of semantics only shows all.
useEffect(() => {
fetchSemanticList(tbl_id).then(setSemList);
}, [tbl_id]);it probably should be more like this.
useEffect(() => {
fetchSemanticList(tbl_id).then( (result) => {
setSemList(result);
setWorking(false);
});
setWorking(true);
}, [tbl_id]);Then in the UI show a working indicator.
There was a problem hiding this comment.
@robyww I did this, but while testing it, DownloadDialog does not update probably because it internally calls showDownloadDialog, which evaluates the JSX only once. so when working is true and let's say I have some text like "Loading....", then when semList is updated and setWorking is set to false, the dialog still does not update.
I tried a few things to make it work, but it was getting quite messy.
So I ended up with the logic i have in the latest commit, DownloadDialog by itself is only called when the call to fetchSemanticList is resolved. So theoretically the user won't see the Generate Download Script button until this is ready (there is some lag though, so I'm not sure if that's good UX)
But it ensures DownloadDialog is populated with the semList when it's available. Let me know what you think.
|
This is not correct. Is it fixed in @loitly's PR? It is not multipart and the options should be immediate. |
SPHEREx TestingThis script is generating lines with folders like download_file 'https://irsatest.ipac.caltech.edu/ibe/data/spherex/qr/level2/2025W35_1A/level2b/5/level2_2025W35_1A_0086_3D5_simu_level2b.fits' 'row_1' ''The folder can't named liked this. You should us the naming algorithm we have. when I run the whole script which came from the first row of a results. download_file 'https://irsatest.ipac.caltech.edu/ibe/data/spherex/qr/level2/2025W35_1A/level2b/5/level2_2025W35_1A_0086_3D5_simu_level2b.fits' 'row_1' ''
download_file 'https://irsatest.ipac.caltech.edu/ibe/cutout?ra=261.57131241460627&dec=-8.364730535295832&size=0.01&path=spherex/qr/level2/2025W35_1A/level2b/5/level2_2025W35_1A_0086_3D5_simu_level2b.fits' 'row_1' ''the script gives me this warning for the second file. it generated only file. I think it is trying to overwrite the name. If you look at the url this makes sense. We have to come up for a solution to this. |
70ef4e1 to
6fcd7a0
Compare
| return ( | ||
| <> | ||
| {loading && <div />} | ||
| {loading && <ToolbarButton enabled={false} variant={isRowSelected?'solid':'soft'} color='warning' text={downloadType === 'script' ? 'Generate Download Script' : 'Prepare Download'}/>} |
There was a problem hiding this comment.
came up with a solution to show a dummy (disabled) button while the semList is loading so as to not have any weird UX movement of a button randomly appearing for the user @robyww.
752b6f4 to
b049f1f
Compare
|
@robyww @loitly I addressed all of the feedback.
Apps to test downloads on:
Note: I have temporarily kept |
|
Looking at the description at the top but not understanding enough of the code to do more detailed following of all the comments, AND empirically playing around with the builds you've linked, here are my $0.02:
|
|
@lrebull I'll address some of your concerns:
@robyww feel free to add to this. |
| url= dlDescriptor?.accessURL; | ||
| url= makeDlUrl(dlDescriptor,table, row); | ||
| catch (err) { | ||
| console.error('fetchSemanticList call failed'); |
There was a problem hiding this comment.
Good. I think the catch needs to be here.
If you want to log the error you should include err as well. I will help to know where the problem happened. IT is possible that getServiceDescriptors() or getObsCoreAccessURL should be fixed.
07a60c4 to
5d793ae
Compare
5d793ae to
aa36148
Compare



Tickets: Firefly-1693 and Firefly-1692
IFE PR: https://github.com/IPAC-SW/irsa-ife/pull/400
filecolumn, if available) for cutouts. But we can move away from doing this as well.PrepareDownloadfromEuclidUtilsintottFeatureWatchersPrepareDownloadwhether they want to display File Structure (flattened vs folder)flattened. Currently Euclid is the only one giving users this option.folder, I have used"row_" + row_indexas the folder name. Open to other suggestions instead of this, but not sure if looking at any of the columns again for this makes sense, in the spirit of keeping it generic?Testing:
Prepare Downloadfor DCE, CADC and SUIT, andGenerate Download Scriptfor Euclid & SPHERExflattenedand thenfolderas the File Structure.