suyashj1231 commented on code in PR #9262:
URL: https://github.com/apache/texera/pull/9262#discussion_r4637590058


##########
frontend/src/app/dashboard/service/user/file/file-saver.service.ts:
##########
@@ -30,4 +30,18 @@ export class FileSaverService {
   saveAs(data: Blob | string, filename?: string, options?: 
FileSaver.FileSaverOptions): void {
     this.saveAsFn(data, filename, options);
   }
+
+  /**
+   * Hands a URL to the browser's own download manager, so the bytes stream to 
disk instead of being buffered in
+   * memory first. The response must carry `Content-Disposition: attachment`, 
otherwise the browser navigates to it.
+   */
+  saveFromUrl(url: string): void {

Review Comment:
   I ran this locally on single-node (lakeFS 1.80 + RustFS). The normal 
download works well, and the file comes down with the right name.
   
   One problem: the link opens in the same tab, so if storage does not return 
the file, the browser leaves Texera and goes to the raw storage URL. I hit this 
with RustFS stopped. An expired URL does the same thing, since it returns 
`AccessDenied: Request has expired`. Texera shows no error toast, and pressing 
Back reloads the app on the Data Card tab. With the old Blob fetch, this case 
showed the "Error downloading file" toast.
   
   I tried adding `link.target = "_blank"` locally. The download still works 
(the new tab closes on its own), and when storage fails, the error opens in 
that tab while Texera stays where it was. `rel="noopener"` only has an effect 
with `target="_blank"`, so this would also make that line useful. Would that 
work here?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to