ACS - Unable to export model from model manager UI

Description

From Share it's possible to use the Model Manager in order to create, edit, import and export custom models.
Currently the export model functionality works as follows:

  • Performs a request to the "/download" endpoint in order to generate the file

  • After 1 second, performs requests to the "<NODE_ID>/status" endpoint until the response states that the file is ready for download (max 10 attempts will be performed, there is 1 second delta between each "/status" requests if the status is "IN_PROGRESS")

  • Once "/status" states that the file is ready for download (status returned is "DONE"), a new popup page is opened within the browser in order to trigger the file download

The problem is that the Javascript code is not able to perform a subsequent retry to the "/status" endpoint after the first attempt due to a Javascript exception, so the export of the custom model does not work if the .zip file takes more than 1 second to be generated within the repository.

Supporting evidence

Steps to reproduce

  • Create a custom model with an aspect and a custom type using the Model Manager

  • Throttle the ACS resources in order to simulate a very slow environment (with MacOS i used an utility called "stress" to consume all my CPU cores)

  • Click "Export" within the actions dropdown menu of a custom model in order to download the .zip file

Expected Behaviour

User is able to download the file

Observed Behaviour

User is not able to download the file, there is no feedback on the UI and there is an exception within the browser console log (see attachment "javascriptConsoleError.png"):

Attached you can also find the .har file with the network requests performed ("exportModelIssue.har") and the prettified JS code where the JS issue is occurring ("javascriptProblem.png").

Workaround

The REST api (https://api-explorer.alfresco.com/api-explorer/#/nodes/getNodeContent) can be used to manually download the file

Environment

None

Testcase ID

None

Assignee

Unassigned

Reporter

Damiano Mondardo

ACT Numbers

00376772

Bug Priority

Category 3