Alright, this one is interesting. I would love to know how this bug got to production… (I think its a bug).
Expected behavior
The smart action should complete successfully.
Actual behavior
I have a smart action configured to download a file (download: true
in the action definition). When this is set to true… the action (which is supposed to download a file) fails. It doesn’t even call the body. Instead it fails because Forest can’t find it.
For example:
Impossible to retrieve the smart action at endpoint /forest/actions/get-engagement-report?timezone=America%2FLos_Angeles and method POST
The issue is in this file, line 61:
forest-express-sequelize/node_modules/forest-express/dist/middlewares/permissions.js
I added a print-out to see why it is not finding the action and I got this:
When I set the action to a regular non-download action (download: false
) Things work as expected (but I can’t trigger the file download). However, Forest does find the action.
Notice how setting “download: true
” causes the action to be called with the timezone attached to the request, whereas, “download: false
” causes the request to not have the timezone attached. When the timezone is attached to the request, Forest fails to find the corresponding action.
Looks like a bug.
Context
7.9.3 (forest-express-sequelize)
8.5.2 (forest-express)
4.17.1( express)