Portal Request Detail UiKit app is invoked several times while page is loading

This happens even with a fresh “Portal Request Detail” UiKit project. It does this both with and without ‘forge tunnel’ being used.

Replication steps are simple:

  1. create a “Portal Request Detail” forge app using uikit template
  2. deploy/install the automatically created template
  3. open a tunnel
  4. load the portal request detail page
  5. observe how it invokes the app multiple times when loading

Is this intended behavior?
If so, how do I prevent the app from running multiple times on load?

Hi @ColtonJeter,

Welcome to the Atlassian Developer Community.

I just tried to see if I could replicate this behaviour when using the jiraServiceManagement:portalRequestDetailPanel module but, with my test app and in my test site, there is a single invocation every time I load the page.

I cannot spot anything wrong with the app in the screenshot, maybe we can add some additional troubleshooting and add a console.log of the context to see if the additional details help.
To do so, you can add the following lines:

const App = () => {
    const context = useProductContext();
    console.log(`context: ${JSON.stringify(context)}`);

I would also try to use an incognito tab when testing, just in case there is a browser extension that is getting in the way.

Let us know,
Caterina

Thank you for your reply,

Some additional potentially helpful information:
I am using Firefox.
This happens both with and without a form attached to the request type.

I added the context print and went to the details page in incognito mode.
Here is just the context:

context: {"accountId":"712020:149a2ade-0055-439e-bf34-81580dd77eda","accountType":"licensed","cloudId":"5b5e8503-2cf8-48f4-80a4-d6fa8b4c1e62","localId":"ari:cloud:ecosystem::extension/19a7f825-833a-48b0-af10-59fc6d40e789/c4a064fc-68f2-418c-99a7-4a553edf7dd5/static/duplicate-execution-replication-hello-world-panel","installContext":"ari:cloud:jira::site/5b5e8503-2cf8-48f4-80a4-d6fa8b4c1e62","extensionContext":{"type":"jiraServiceManagement:portalRequestDetail","portal":{"id":1004},"request":{"typeId":1040,"key":"FSCM-229"}},"moduleKey":"duplicate-execution-replication-hello-world-panel"}
Full Log
Stopping tunnel...
Tunnel stopped.
work@Coltons-MacBook-Pro Duplicate-Execution-Replication % forge tunnel
Warning: Your version of Forge CLI is out of date. We recommend you update to the latest version to get the latest features and bug fixes.
Run npm uninstall -g @forge/cli followed by npm install -g @forge/cli to update from version 6.16.0 to 6.16.1.

Tunnel redirects requests you make to your local machine. This occurs for any Atlassian site where your app is installed in the specific development environment. You will not see requests from other users.
Press Ctrl+C to cancel.

Checking Docker image... failed   
Cannot pull the tunnel image.

Tunnel uses an anonymous ngrok account, which has a time limit of 2 hours. After that time, you'll need to restart your tunnel.

=== Running forge lint...
No issues found.

=== Bundling code...
✔ Functions bundled.

=== Snapshotting functions...
No log output.


Listening for requests...


invocation: 0000000000000000be9b7a1569997c05 index.run

invocation: 0000000000000000a639a8dbb4fa53fa index.run

invocation: 0000000000000000b694795e4daf0146 index.run

invocation: 0000000000000000bb3485760b5d7e96 index.run

invocation: 0000000000000000acd49bb88a30bf3d index.run

invocation: 0000000000000000a145fddf79e69e83 index.run

invocation: 0000000000000000bcc3420b9e33051b index.run

invocation: 00000000000000009677ae5e22d8212b index.run

invocation: 0000000000000000874fb264f2cfdc96 index.run
INFO    16:20:42.055  0000000000000000bb3485760b5d7e96  Running App
INFO    16:20:42.059  0000000000000000b694795e4daf0146  Running App
INFO    16:20:42.060  0000000000000000be9b7a1569997c05  Running App
INFO    16:20:42.060  0000000000000000bb3485760b5d7e96  context: {"accountId":"712020:149a2ade-0055-439e-bf34-81580dd77eda","accountType":"licensed","cloudId":"5b5e8503-2cf8-48f4-80a4-d6fa8b4c1e62","localId":"ari:cloud:ecosystem::extension/19a7f825-833a-48b0-af10-59fc6d40e789/c4a064fc-68f2-418c-99a7-4a553edf7dd5/static/duplicate-execution-replication-hello-world-panel","installContext":"ari:cloud:jira::site/5b5e8503-2cf8-48f4-80a4-d6fa8b4c1e62","extensionContext":{"type":"jiraServiceManagement:portalRequestDetail","portal":{"id":1004},"request":{"typeId":1040,"key":"FSCM-229"}},"moduleKey":"duplicate-execution-replication-hello-world-panel"}
INFO    16:20:42.060  0000000000000000b694795e4daf0146  context: {"accountId":"712020:149a2ade-0055-439e-bf34-81580dd77eda","accountType":"licensed","cloudId":"5b5e8503-2cf8-48f4-80a4-d6fa8b4c1e62","localId":"ari:cloud:ecosystem::extension/19a7f825-833a-48b0-af10-59fc6d40e789/c4a064fc-68f2-418c-99a7-4a553edf7dd5/static/duplicate-execution-replication-hello-world-panel","installContext":"ari:cloud:jira::site/5b5e8503-2cf8-48f4-80a4-d6fa8b4c1e62","extensionContext":{"type":"jiraServiceManagement:portalRequestDetail","portal":{"id":1004},"request":{"typeId":1040,"key":"FSCM-229"}},"moduleKey":"duplicate-execution-replication-hello-world-panel"}
INFO    16:20:42.061  0000000000000000a639a8dbb4fa53fa  Running App
INFO    16:20:42.061  0000000000000000a639a8dbb4fa53fa  context: {"accountId":"712020:149a2ade-0055-439e-bf34-81580dd77eda","accountType":"licensed","cloudId":"5b5e8503-2cf8-48f4-80a4-d6fa8b4c1e62","localId":"ari:cloud:ecosystem::extension/19a7f825-833a-48b0-af10-59fc6d40e789/c4a064fc-68f2-418c-99a7-4a553edf7dd5/static/duplicate-execution-replication-hello-world-panel","installContext":"ari:cloud:jira::site/5b5e8503-2cf8-48f4-80a4-d6fa8b4c1e62","extensionContext":{"type":"jiraServiceManagement:portalRequestDetail","portal":{"id":1004},"request":{"typeId":1040,"key":"FSCM-229"}},"moduleKey":"duplicate-execution-replication-hello-world-panel"}
INFO    16:20:42.061  0000000000000000be9b7a1569997c05  context: {"accountId":"712020:149a2ade-0055-439e-bf34-81580dd77eda","accountType":"licensed","cloudId":"5b5e8503-2cf8-48f4-80a4-d6fa8b4c1e62","localId":"ari:cloud:ecosystem::extension/19a7f825-833a-48b0-af10-59fc6d40e789/c4a064fc-68f2-418c-99a7-4a553edf7dd5/static/duplicate-execution-replication-hello-world-panel","installContext":"ari:cloud:jira::site/5b5e8503-2cf8-48f4-80a4-d6fa8b4c1e62","extensionContext":{"type":"jiraServiceManagement:portalRequestDetail","portal":{"id":1004},"request":{"typeId":1040,"key":"FSCM-229"}},"moduleKey":"duplicate-execution-replication-hello-world-panel"}
INFO    16:20:42.109  0000000000000000acd49bb88a30bf3d  Running App
INFO    16:20:42.110  0000000000000000acd49bb88a30bf3d  context: {"accountId":"712020:149a2ade-0055-439e-bf34-81580dd77eda","accountType":"licensed","cloudId":"5b5e8503-2cf8-48f4-80a4-d6fa8b4c1e62","localId":"ari:cloud:ecosystem::extension/19a7f825-833a-48b0-af10-59fc6d40e789/c4a064fc-68f2-418c-99a7-4a553edf7dd5/static/duplicate-execution-replication-hello-world-panel","installContext":"ari:cloud:jira::site/5b5e8503-2cf8-48f4-80a4-d6fa8b4c1e62","extensionContext":{"type":"jiraServiceManagement:portalRequestDetail","portal":{"id":1004},"request":{"typeId":1040,"key":"FSCM-229"}},"moduleKey":"duplicate-execution-replication-hello-world-panel"}
INFO    16:20:42.115  0000000000000000a145fddf79e69e83  Running App
INFO    16:20:42.116  0000000000000000a145fddf79e69e83  context: {"accountId":"712020:149a2ade-0055-439e-bf34-81580dd77eda","accountType":"licensed","cloudId":"5b5e8503-2cf8-48f4-80a4-d6fa8b4c1e62","localId":"ari:cloud:ecosystem::extension/19a7f825-833a-48b0-af10-59fc6d40e789/c4a064fc-68f2-418c-99a7-4a553edf7dd5/static/duplicate-execution-replication-hello-world-panel","installContext":"ari:cloud:jira::site/5b5e8503-2cf8-48f4-80a4-d6fa8b4c1e62","extensionContext":{"type":"jiraServiceManagement:portalRequestDetail","portal":{"id":1004},"request":{"typeId":1040,"key":"FSCM-229"}},"moduleKey":"duplicate-execution-replication-hello-world-panel"}
INFO    16:20:42.120  0000000000000000bcc3420b9e33051b  Running App
INFO    16:20:42.121  0000000000000000bcc3420b9e33051b  context: {"accountId":"712020:149a2ade-0055-439e-bf34-81580dd77eda","accountType":"licensed","cloudId":"5b5e8503-2cf8-48f4-80a4-d6fa8b4c1e62","localId":"ari:cloud:ecosystem::extension/19a7f825-833a-48b0-af10-59fc6d40e789/c4a064fc-68f2-418c-99a7-4a553edf7dd5/static/duplicate-execution-replication-hello-world-panel","installContext":"ari:cloud:jira::site/5b5e8503-2cf8-48f4-80a4-d6fa8b4c1e62","extensionContext":{"type":"jiraServiceManagement:portalRequestDetail","portal":{"id":1004},"request":{"typeId":1040,"key":"FSCM-229"}},"moduleKey":"duplicate-execution-replication-hello-world-panel"}

invocation: 0000000000000000911c4ba498880c1d index.run

invocation: 0000000000000000934f409e20911b01 index.run

invocation: 0000000000000000bffb6083ff3f5812 index.run
INFO    16:20:42.240  00000000000000009677ae5e22d8212b  Running App
INFO    16:20:42.241  00000000000000009677ae5e22d8212b  context: {"accountId":"712020:149a2ade-0055-439e-bf34-81580dd77eda","accountType":"licensed","cloudId":"5b5e8503-2cf8-48f4-80a4-d6fa8b4c1e62","localId":"ari:cloud:ecosystem::extension/19a7f825-833a-48b0-af10-59fc6d40e789/c4a064fc-68f2-418c-99a7-4a553edf7dd5/static/duplicate-execution-replication-hello-world-panel","installContext":"ari:cloud:jira::site/5b5e8503-2cf8-48f4-80a4-d6fa8b4c1e62","extensionContext":{"type":"jiraServiceManagement:portalRequestDetail","portal":{"id":1004},"request":{"typeId":1040,"key":"FSCM-229"}},"moduleKey":"duplicate-execution-replication-hello-world-panel"}
INFO    16:20:42.251  0000000000000000874fb264f2cfdc96  Running App
INFO    16:20:42.251  0000000000000000934f409e20911b01  Running App
INFO    16:20:42.251  0000000000000000874fb264f2cfdc96  context: {"accountId":"712020:149a2ade-0055-439e-bf34-81580dd77eda","accountType":"licensed","cloudId":"5b5e8503-2cf8-48f4-80a4-d6fa8b4c1e62","localId":"ari:cloud:ecosystem::extension/19a7f825-833a-48b0-af10-59fc6d40e789/c4a064fc-68f2-418c-99a7-4a553edf7dd5/static/duplicate-execution-replication-hello-world-panel","installContext":"ari:cloud:jira::site/5b5e8503-2cf8-48f4-80a4-d6fa8b4c1e62","extensionContext":{"type":"jiraServiceManagement:portalRequestDetail","portal":{"id":1004},"request":{"typeId":1040,"key":"FSCM-229"}},"moduleKey":"duplicate-execution-replication-hello-world-panel"}
INFO    16:20:42.251  0000000000000000934f409e20911b01  context: {"accountId":"712020:149a2ade-0055-439e-bf34-81580dd77eda","accountType":"licensed","cloudId":"5b5e8503-2cf8-48f4-80a4-d6fa8b4c1e62","localId":"ari:cloud:ecosystem::extension/19a7f825-833a-48b0-af10-59fc6d40e789/c4a064fc-68f2-418c-99a7-4a553edf7dd5/static/duplicate-execution-replication-hello-world-panel","installContext":"ari:cloud:jira::site/5b5e8503-2cf8-48f4-80a4-d6fa8b4c1e62","extensionContext":{"type":"jiraServiceManagement:portalRequestDetail","portal":{"id":1004},"request":{"typeId":1040,"key":"FSCM-229"}},"moduleKey":"duplicate-execution-replication-hello-world-panel"}
INFO    16:20:42.267  0000000000000000911c4ba498880c1d  Running App
INFO    16:20:42.267  0000000000000000911c4ba498880c1d  context: {"accountId":"712020:149a2ade-0055-439e-bf34-81580dd77eda","accountType":"licensed","cloudId":"5b5e8503-2cf8-48f4-80a4-d6fa8b4c1e62","localId":"ari:cloud:ecosystem::extension/19a7f825-833a-48b0-af10-59fc6d40e789/c4a064fc-68f2-418c-99a7-4a553edf7dd5/static/duplicate-execution-replication-hello-world-panel","installContext":"ari:cloud:jira::site/5b5e8503-2cf8-48f4-80a4-d6fa8b4c1e62","extensionContext":{"type":"jiraServiceManagement:portalRequestDetail","portal":{"id":1004},"request":{"typeId":1040,"key":"FSCM-229"}},"moduleKey":"duplicate-execution-replication-hello-world-panel"}
INFO    16:20:42.279  0000000000000000bffb6083ff3f5812  Running App
INFO    16:20:42.280  0000000000000000bffb6083ff3f5812  context: {"accountId":"712020:149a2ade-0055-439e-bf34-81580dd77eda","accountType":"licensed","cloudId":"5b5e8503-2cf8-48f4-80a4-d6fa8b4c1e62","localId":"ari:cloud:ecosystem::extension/19a7f825-833a-48b0-af10-59fc6d40e789/c4a064fc-68f2-418c-99a7-4a553edf7dd5/static/duplicate-execution-replication-hello-world-panel","installContext":"ari:cloud:jira::site/5b5e8503-2cf8-48f4-80a4-d6fa8b4c1e62","extensionContext":{"type":"jiraServiceManagement:portalRequestDetail","portal":{"id":1004},"request":{"typeId":1040,"key":"FSCM-229"}},"moduleKey":"duplicate-execution-replication-hello-world-panel"}
> ```

Hi @ColtonJeter,

We checked a few things on our end but couldn’t understand what is happening.

Would you be able to raise a support ticket for this at this link?

Please also add the following:

  • the log of the forge tunnel --verbose command
  • a HAR file for the same execution contained in the Forge tunnel log
  • a recording of the screen when loading the Portal request

There might be more that is needed for the investigation but this should be a solid starting point.

Thank you,
Caterina

Hey @ccurti, Thank you for getting back to me.

Some an interesting piece of information I found when testing:
When doing a hard refresh of the page it only executes once, but a normal refresh causes several executions.

I will make a support ticket and provide the requested information now.

Thank you again,
Colton