I am currently having an issue with my SAPUI5 apps hosted on the Cloud Platform. Our Cloud Platform subaccount was setup in such a way that it uses the same identity provider used by our S/4HANA Cloud system. The standalone UI5 apps also use OData/SOAP APIs from the API Business Hub which is pointed to our S/4HANA Cloud system.
So our users now run into an issue with our UI5 apps on the Cloud Platform when a session timeout happens on S/4HANA Cloud. It looks like the logout is being triggered client-side / on the browser, so take this scenario where the user has both a Fiori app and our standalone UI5 app opened on separate tabs. User leaves the Fiori app tab unattended long enough, maybe 1 minute before timeout happens. While the user is working on the standalone UI5 app, the Fiori app tab triggers a logout, now when the UI5 app calls the APIs, the requests will get a response of HTTP 401 / Unauthorized.
One of our apps in particular parses an input file and creates hundreds of records by sending multiple requests to a SOAP webservice. So while our UI5 app is performing this operation, and logout is triggered, succeeding requests after logout will now fail. I have not yet tested if our apps using OData instead of SOAP, and are sending 1 very large batch request instead of multiple requests, will run into the same issue.
I tried implementing a workaround where the UI5 apps sends a dummy request to the service every now and then, but it seems that the automatic logout triggered by the Fiori app tab bypasses this anyway.
Is there something I can do to prevent this from happening?