Our app is making a processing in our side and after that when we update the issue description using the REST API, only the first time after that app was loaded in the issue, the app crash. We validate that it is happening after call to the rest api to update the issue description, but the response is successful. Also we cannot see the error on Atlassian console. Any suggestion how test, fix or make a workaround to avoid it?
Once that the app was used the first time in an issue, does not matters that we loaded the issue again in a fresh browser session it works properly without any error.
This issue seems to be similar: https://community.developer.atlassian.com/t/issue-panel-crashes-on-issue-update/71494
Scenarios to reproduce the issue:
Crash scenario 1
- Create an issue using the “Create” button
- Open the created issue by clicking the “View issue” button in the toast message at the bottom left corner
- Open the Jira panel app (the panel renders below the issue description)
- Trigger a REST call by pressing a button
- Rest call edits the issue successfully
- Jira panel crashes and says “Unexpected Error”
Crash scenario 2
- Create an issue using the “Create” button
- Open the created issue by clicking the “View issue” button in the toast message at the bottom left corner
- Refresh the page
- Open the Jira panel app (the panel renders below the issue description)
- Trigger a REST call by pressing a button
- Rest call edits the issue successfully
- Jira panel crashes and says “Unexpected Error”
Crash scenario 3
- From the project backlog, create an issue using the “Create” button
- Find the created issue on the Backlog list and open it by clicking it
- The issue opens in the panel on the right
- Open the Jira panel app (the panel renders below the issue description)
- Trigger a REST call by pressing a button
- Rest call edits the issue successfully
- Jira panel crashes and says “Unexpected Error”
Crash scenario 4 In this scenario, we modify the code to update the issue data when the panel mounts, using the useEffect
hook.
- Create an issue using the “Create” button
- Open the created issue by clicking the “View issue” button in the toast message at the bottom left corner
- Open the Jira panel app (the panel renders below the issue description)
- The REST call is triggered automatically
- Rest call edits the issue successfully
- Jira panel crashes and says “Unexpected Error”
Success scenario 1
- Create an issue using the “Create” button
- Open the created issue by clicking the “View issue” button in the toast message at the bottom left corner
- Open the Jira panel app (the panel renders below the issue description)
- Refresh the page
- Trigger a REST call by pressing a button
- Rest call edits the issue successfully
- Jira panel does not crash
Note: The last scenario is not a solution because it requires that the user refresh the page, and thats is a really poor user experience because we need to guide the user to make it to avoid a Jira crash.
We ran the tests using:
@forge/api: 2.18.3, @forge/ui: 1.9.1
and
@forge/api: ^2.11.0, @forge/ui: 1.6.0