Hi, I'm currently new to the OutSystems platform. It's been a great week so far! Anyway, here's my situation.
I have a screen with a table containing a list of data. For each row, a cell calls upon a block with input parameters defined by other column values from the same row.
The said block implements a websocket connection (using any one of the Forge solutions available). At this point, on the frontend I am able to correctly stream the data I need from the websocket, even on refresh of the main table after sorting or filtering.
The problem is when I do refresh the data (by sorting, filtering, or any means), the following message pops up in the error logs, proportional to the number of the times a websocket connection was created within the table, every second.
Invalid call of the '***' client action of the 'MainFlow.{Screen or Block}' 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.
Unknowingly, because of this I have greatly exceeded my Database capacity. And somehow, I can't even clear the oslog_Error_9 table using the DB Cleaner on Steroids.
Upon scouring through posts here in the forum and other sources online, it seems that the general way to get rid of this error is to disable or end the action that is being called after the block calling it is destroyed through the OnDestroy event of the said block.
Unfortunately, I am unable to do that with the websocket inside a block called from multiple rows of a table, even using the disconnect or close socket client actions on the OnDestroy event of the block.
Please help? Thank you!
Hi Jay,
Not sure whether opening a web socket inside blocks is a good idea, but regardless, you wrote "I am unable to do that". That's a bit too vague a description to know what's going on. Did you actually close the socket in the OnDestroy? What happens if you do? What do you expect should happen? Etc.
Hello Kilian,
I've actually managed to solve that little complication by calling the CloseSocket event on the OnDestroy event of the websocket block instead of the block calling it. The only issue however is, if I switch the app to background (either by going home or opening another app) where the websocket block is destroyed, then reopen it again to foreground after some time, the connection is not reestablished and I have to quit and open the app for it to work.