62
Views
2
Comments
Solved
Polling system
Application Type
Reactive

Hi there,

I'm trying to set up a polling mechanism in my app.
I have a couple of long-run jobs triggered by some events: for now, in the onReady of my screen i have a js script with a setInterval() function that call a server action which check for the status of those jobs executions each 30 secs: if it is ended enable a button or trigger the refresh of some data actions.

However from ODC platform logs i can see errors like this:
OS-CLRT-60801 - Invalid call of action 'RefreshAppStatus' Invalid call of the 'RefreshAppStatus' client action of the 'MainFlow.Main' since the latter is not currently active. This is likely due to a platform's client action being used as an event handler or in a setTimeout function. Consider removing this call by using the 'On Destroy' event of the screen/block or moving your logic to a global client action.

So i'm asking:
Is there a way to use the platform's events to trigger some UI changes or make them by workflow feature? (i know i can trigger a human activity but is not what i'm searching for)

otherwise what i'm doing wrong with my current implementation? is there a better way?

I'll attach an example app with related workflow (i don't know why but in the example app i don't have the error described above)
- timers runs for 30 secs each
- poll every 5 secs

THX.

exampleAppWorkflow.oml
exampleAPP.oml
2025-01-09 14-56-57
IQ78
Solution

https://www.outsystems.com/forge/component-overview/19214/sse-data-list-auto-refresh-o11

2019-01-07 16-04-16
Siya
 
MVP

The reason you are getting the error 'Invalid call of action 'RefreshAppStatus'' is that your screen is no longer active, but the timer created in onReady is still running. To prevent this, you must call clearInterval in the OnDestroy event.

If you need real-time notifications on the screen, consider using Firebase notifications or Pusher.

2025-01-09 14-56-57
IQ78
Solution

https://www.outsystems.com/forge/component-overview/19214/sse-data-list-auto-refresh-o11

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.