October: AJAX loading indicator does not properly stop after receiving a redirect response to a file download

Created on 28 Apr 2020  路  10Comments  路  Source: octobercms/october

Completed Bug

All 10 comments

@datune If you have time, would you mind providing us with a test case to the Test plugin demonstrating this issue?

I do confirm this behavior.

@mjauvin Do you have a test case I can review for it?

No, I don't.

@bennothommo

public function onTestRedirect()
{
    return redirect()->to('path/to/file/to/be/downloaded/by/the/browser.csv');
}

Thanks @LukeTowers, but I do know how to do a redirect ;). I was simply asking if someone might've set up a link or action with an AJAX handler and the necessary attributes to show the loader, ie. data-load-indicator.

Oh, sorry about that @bennothommo, thought you were confused about the exact implementation of the handler. I believe all AJAX requests in the backend trigger the stripe loading indicator though don't they?

I have the same behavior.

I have the download page as follows:

title = "Download"
layout = "default"
is_hidden = 0

==
    function onStart()
    {
        $pathToFile = storage_path('static/import-template.xlsx');
        $fileName = 'import-template.xlsx';
        $headers = [
            "Content-Type: => "application/xlsx"
        ];

        return Response::download($pathToFile, $fileName, $headers);
    }
==

I have an ajax handler that redirects to this page:

public function onDownloadImportTemplate(){
    return Redirect::to('download');
}

The steps are the following:

  1. I click the download button
  2. The "onDownloadImportTemplate" ajax handler is executed
  3. I am redirected to the download page
  4. The download prompt is displayed

Everything works as expected until here.

After I finish the download, as mentioned in the title, the AJAX loading indicators (from the top of the page and the loading circle that replaces the mouse pointer) reappear.

The only way to bring the page back to normal is to do a manual refresh.

This issue will be closed and archived in 3 days, as there has been no activity in the last 60 days.
If this issue is still relevant or you would like to see it actioned, please respond and we will re-open this issue.
If this issue is critical to your business, consider joining the Premium Support Program where a Service Level Agreement is offered.

This issue will be closed and archived in 3 days, as there has been no activity in the last 60 days.
If this issue is still relevant or you would like to see it actioned, please respond and we will re-open this issue.
If this issue is critical to your business, consider joining the Premium Support Program where a Service Level Agreement is offered.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

EbashuOnHolidays picture EbashuOnHolidays  路  3Comments

SeekAndPwn picture SeekAndPwn  路  3Comments

dunets picture dunets  路  3Comments

jvanremoortere picture jvanremoortere  路  3Comments

lukaszbanas-extremecoding picture lukaszbanas-extremecoding  路  3Comments