It keeps loading after download

I use the following code to download my result as json file:

let filename = projectId + ".json";
res.set({
"Access-Control-Expose-Headers": "Content-Disposition",
"Content-Disposition": `attachment; filename="${filename}"`,
"Content-Type": "application/json",});
return res.send(result);

After the download is done, the status banner keeps loading and does not go to completion. Can you please help me thank you

Hello @mostafa_hatem,

Could you please add the info that is requested when creating a new community post asking for help? All these info are very important for us to understand the context, as it differs from one installation to another.

This is a template you can use to report issues. You can also drag images, videos and include Preformatted text

Expected behavior

Please describe here the behavior you are expecting.

Actual behavior

What is the current behavior?

Failure Logs

Please include any relevant log snippets, if necessary.

Context

Please provide any relevant information about your setup.

  • Package Version:
  • Express Version:
  • Sequelize Version:
  • Database Dialect:
  • Database Version:
  • Project Name:

I suppose that you configured a smart action to be executed on multiple entries, and in the code of this smart action, you returned a json file as attachment?

Can you please also share with us the declaration of your smart action?

Expected behavior

download file and return successful status 204

Actual behavior

file downloaded but the banner remained blue (loading) “download project is executing”

Failure logs

none

Context

  • “express”: “~4.17.1”,
  • “express-jwt”: “6.0.0”,
  • “forest-express-mongoose”: “^8.0.0”,
  • “mongoose”: “~5.8.2”,
  • Project Name: simulationService
  • database: mongodb

smart action:

{
  name: "Download Project",
  type: "single",
  download: true,
},

post request:

let result = (await axios.get(url, config)).data; // json data
let filename = projectId + ".json"; // filename based on a variable

res.set({
  "Access-Control-Expose-Headers": "Content-Disposition",
  "Content-Disposition": `attachment; filename="${filename}"`,
  "Content-Type": "application/json",
});

return res.send(result);

Thanks for the details. Can you please open the network tab of your developer tools before launching the Smart Action?

Then, identify the request that corresponds to your smart action, and copy/paste all details about the request and the response. I would like to check if the smart action is correctly configure and returning the expected response (that would indicate a problem in the frontend) or if the response is incorrect.

I created a smart action on a test project and could reproduce your issue.

I’m creating a bug ticket on our side and let you know when it’ll be fixed.

Okay Thank you for your support

Hello @mostafa_hatem,

We released a fix for the problem you reported. Can you refresh your browser and test if it’s working as expected?

Hello @GuillaumeGautreau,
Everything seems to be working as expected right now, thanks again for the support and fast response.