Hello,
I am facing an issue in the Mobile and PWA application while using OutSystemUI web block Private/ApplicationLoadEvents.
Private/ApplicationLoadEvents web block has two events OnUpgradeProgress and OnLoadComplete. The web block is nested inside our web block named ApplicationUpgrade (present in all layouts). In the OnLoadComplete event, we are handling internal updates/upgrades of our application, and OnUpgradeProgess is only used in the Splash screen to show the progress of the loading bar. Now, since the web block is present in the layout, both events OnUpgradeProgress and OnLoadComplete are triggered for every screen/page regardless.
Now the issue is if the user navigates away from the screen while it was still loading ( Private/ApplicationLoadEvents events still processing), we get the following exceptions:
We have tried to solve the above-mentioned exception using OnDestroy as well as clearTimeout but the exception still throws because the execution of events of ApplicationLoadEvents has not been completed.
Thank in advance
Regards, Wasif
Hi @Wasif Iqbal ,
This topic has already been answered here in a duplicate post.
Best Regards,GM
Dear Wasif,
It seems like this is a known issue of the platform. Please follow the link below for the probable solution:
Mobile apps: How to use OnDestroy to avoid Invalid call of the * error? | OutSystems
With best regards,
Shounak
Hello Shounak,
I have applied the solution mentioned from the URL already and it doesn't fix my problem.
Thank you
Hi Wasif,
Indeed this problem happens when the handler is called and the page is already destroyed.
I solved this problems by adding a local variable to the layout called IsDestroyed which starts at False.
On the event handler OnDestroy, I set this variable to True and then on the handlers, I only do screen interaction if the IsDestroyed is False:
Something like the example above.
Hope it helps.
Regards,JoĂ£o
Hello JoĂ£o Marques,
I have used IsDestroyed variable logic from OnDestroy (as you mentioned above). But the issue is that the Private/ApplicationLoadEvents keeps triggering the OnUpgradeProgress event which creates a trail of exception in our service center error log.
Hi Wasif Iqbal,
Do you also encounter high CPU Utilization because of this issue?
Regards,
Gerrick