fleetdm / fleet

Open-source platform for IT, security, and infrastructure teams. (Linux, macOS, Chrome, Windows, cloud, data center)
https://fleetdm.com
Other
2.7k stars 383 forks source link

Use browser's progress bar to download software package #19561

Open marko-lisica opened 1 month ago

marko-lisica commented 1 month ago

Goal

User story
As an IT admin,
I want to download the software package the same way I'm used to do in other app
so that I can see my download progress in the browser.

Context

When clicking on download button nothing happens. It downloads package in the background, but don't display anything to user.

Changes

Product

On download request the backend will store a one time token in redis for this software installer id / token combo that expires in 10m or when used. The backend request will then redirect 302 to the url with token=<valid_token> for the UI to download in the browser.

Frontend may have to (catch / no redirect) the request / response to be able to extract the url and send that to the browser.

ℹ️  Please read this issue carefully and understand it. Pay special attention to UI wireframes, especially "dev notes".

QA

Risk assessment

Manual testing steps

  1. Step 1
  2. Step 2
  3. Step 3

Testing notes

Confirmation

  1. [ ] Engineer (@____): Added comment to user story confirming successful completion of QA.
  2. [ ] QA (@____): Added comment to user story confirming successful completion of QA.
marko-lisica commented 1 month ago

@ghernandez345 @georgekarrv I brought this to design review today. We think that it's worth investing time to get experience that other app have (to use native browser progress for download). We can address this only for software download for now and later improve other endpoints if necessary. GitHub is good example, they download smaller files in the background, but if you try to download the whole repo (private one - I believe it's authenticated) it downloads through native browser's progress bar.

cc @noahtalerman

noahtalerman commented 1 month ago

Hey @georgekarrv, I saw you adding this bug to the drafting board. Does it need more drafting? If not, can we please pull it into the release?

georgekarrv commented 1 month ago

The discussion in yesterday's scrum was that to achieve the desired behavior we would need an additional endpoint to generate a token for the download unauthenticated.

This token will need to be stored for 10m or until used whichever comes first.

Then update the download endpoint to do this token lookup. At this point the desired changes are a feature request (since the workflow is not broken it's just 'slow' plus these desired changes would be adding new features this is now a bug that is not a bug)

noahtalerman commented 1 month ago

@georgekarrv agreed we should take this through drafting as a story!

PezHub commented 1 month ago

This ended up getting taking care of via this ticket

roperzh commented 1 month ago

@PezHub unfortunately not :(! any chance you were using your local server? it might have given you the impression given how fast it is locally

PezHub commented 1 month ago

You're totally right. after throttling my speeds I now see the long delay before the download progress bar appears. My bad!

georgekarrv commented 1 month ago

Hey team! Please add your planning poker estimate with Zenhub @dantecatalfamo @ghernandez345 @gillespi314 @mna @roperzh