fantonangeli opened a new pull request, #2727:
URL: https://github.com/apache/incubator-kie-tools/pull/2727

   **Closes** https://github.com/apache/incubator-kie-tools/issues/2656
   
   ## Description:
   The jobs list status continues to display expires in NN minutes even after a 
job has expired.
   
   ### Steps to Reproduce
   1. Go to: https://start.kubesmarts.org/dev
   2. Setup an OpenShift connection with DevMode
   3. Create a workflow using 
https://github.com/dmarrazzo/swf-simple-order/blob/main/src/main/resources/timeout.sw.yaml
   4. Upload the workflow to OpenShift in DevMode
   5. Start the workflow and quickly move to the next step
   6. Open the workflow details and view the Jobs list
   7. Observe that the job shows "expires in a few seconds" (see screenshot 1)
   8. Wait a few minutes after the expiration time
   9. Observe that the job expiration changes to "expires in NN minutes" and 
the status remains as "scheduled" (see screenshot 2)
   
   ### Expected Result
   The jobs list should refresh after the job expiration.
   
   
   ### Actual Result
   After expiration, the jobs list shows "expires in NN minutes" and the status 
remains "scheduled" even after expiration.
   
   
![image](https://github.com/user-attachments/assets/484d7fe5-dc64-4fe5-a802-f7f5bb4347b2)
   
![image](https://github.com/user-attachments/assets/b557dd18-1dd5-42cb-ac4f-736eb8ea204e)
   
   ## Solution:
   - Check every 5 seconds if there is a SCHEDULED job. 
   - If the job is not expired check again after 5 seconds
   - If the job is expired refresh the jobs data from the data-index
   
   ## How to test locally:
   - `pnpm -F sonataflow-deployment-webapp start`
   - open 
http://localhost:9023/#/runtime-tools/workflow-details/9750c042-3fb2-40b7-96ba-ff10b6178c58
   - the status of the job "a62d9d0" is "Scheduled"
   - in a terminal, simulate the job execution:
   ```bash
   curl -X POST http://localhost:4000/graphql \
        -H "Content-Type: application/json" \
        -d '{
              "query": "mutation JobExecute($id: String!) { JobExecute(id: $id) 
}",
              "variables": {
                "id": "a62d9d0a-87ea-4c13-87fb-67965d133020"
              }
            }'
   ```
   - wait 5 seconds
   - the status of the job "a62d9d0" is "Executed"
   
   ## Preview:
   
[kie-tools-issues#2656.webm](https://github.com/user-attachments/assets/990eb085-7bc1-4f97-a011-4f3e8625ed3f)
   
   
   ## Notes:
   - I refactored some code to align more the `WorkflowDetaills` component to 
`ProcessDetails` and use the `useCallback` like in React best practices
   - @tiagobento Maybe you are interested to replicate this functionality to 
`packages/runtime-tools-process-enveloped-components/src/processDetails/envelope/components/ProcessDetails/ProcessDetails.tsx`
 ?
   - thanks @dmarrazzo for the repository with test Workflows


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to