Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Downloads are routed before "Save as" dialog closes #88

Open
Raul1198 opened this issue Apr 14, 2024 · 4 comments
Open

Downloads are routed before "Save as" dialog closes #88

Raul1198 opened this issue Apr 14, 2024 · 4 comments

Comments

@Raul1198
Copy link

when the browser is set to "Always ask you where to save files" and the file is being downloaded via Varia the file is downloaded by both the browser and Varia Application, but when in browser it is unticked (Always ask you where to save files) the file is downloaded only once example

  1. here we see , when "Always ask you where to save files" is enabled the file is downloaded twice
    Screencast from 2024-04-14 16-35-54.webm

  2. here when "Always ask you where to save files" is disabled the file downloaded only once
    Screencast from 2024-04-14 16-38-59.webm

in 2 we see that file to be download is added in firefox's download drop down but it cancelled automatically and instead downloaded via Varia can this same property to auto cancel and download via Varia done when ask where to download is enabled.

INFO
-OS Fedora Workstation 39
-Browser = Native Firefox RPM preinstalled
-Varia = Flatpak v2024.3.20

@giantpinkrobots
Copy link
Owner

Hello. Sorry for the late reply.

I'm struggling to recreate this problem. The download is not routed to Varia until the user clicks on save in the "Choose where to download" window. After the user clicks on save, the download on the browser is cancelled and instead routed to Varia.

Ekran.kaydi.-.2024-04-24.15-20-16.mp4

I tried it on Chrome as well, the problem didn't occur there either.

@Raul1198
Copy link
Author

i think this issue is hit or miss type's as i too am not having this issue sometimes , just update my system to fedora 40 yesterday and did a download test (downloaded fedora kinoite iso) at first for a small instance a download is shown in firefox download drop down and then it is cancelled and started in Varia with "ask where to save" toggled on. is your firefox flatpak or native package ?

can you try downloading the zip from https://github.com/siavash79/PixelXpert/releases as i was able to produce double download

with ask enabled

Screencast.from.2024-04-26.12-44-43.mp4

with ask disabled

Screencast.from.2024-04-26.12-49-37.mp4

also tried it on brave flatpak with both ask enabled and disable there it work without creating any double downloaded file

@giantpinkrobots
Copy link
Owner

Hey, today on Chrome I did manage to recreate the problem.

I have been trying to fix the issue but so far all my attempts have been unsuccessful since they have been complete shots in the dark. I couldn't find a proper API call that would allow the extension to check if the download has actually started.

I can modify Varia's code to prevent multiple downloads from the same URL from being downloaded, but that would mean the download would still start before the user has pressed Save in the File Save dialog - only it would cancel the duplicate download. So that's not exactly an ideal solution.

It still doesn't occur on Firefox. (using the native package)

@giantpinkrobots giantpinkrobots pinned this issue Apr 26, 2024
@giantpinkrobots
Copy link
Owner

After a long time of fiddling with the browser extension I finally caved and implemented the band-aid solution. The attempts of routing the same URL by the browser extension are now blocked. This fixes the double-download issue, however it's not ideal as the download starts before the user presses Save on the Save as dialog.

I also added a notification to notify the user when the download is routed from the browser, so that way they'll see the download has begun. But this won't work if the user has do not disturb enabled.

I will change the title of this issue as downloads are no longer duplicated. But we still need to find a better solution than this.

@giantpinkrobots giantpinkrobots changed the title Double File Downloading Downloads are routed before "Save as" dialog closes May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants