My app is freezing for a period of time when using a web block I built. It then resumes as normal. I assume it is the JS blocking somehow but I am not sure.
What is happening is as follows:1. The input parameters for the web block in question are changing since I am changing something in the main screen - a text input into which I am typing
2. In the OnParametersChanged of the web block, if a particular input changes then, I am triggering an event
3. This event is handled on the main screen and changes some of the input parameters for the web bock - but in a way that the web block will not again run the event since the parameter that triggers the event is not changed on the second time arounf.
4. End of flow
Seems like it should be fine. However, each time I type a new letter the freeze period is longer and longer. What am I missing here?
(There is some JS on the InputMask React Forge Asset that I am using which could be causing something to go wrong but again, not sure how).
I have tried to track the performance of the app in the Google Dev tools but it is not giving anything useful and is painfully slow - probably because of how much JS is running - since I assume this is causing the blocking.
I can't upload the OML.
Hi, I removed both InputMaskReactFlow\MaskCurrency widgets, and then the issues seems to disappear and your screen and block behave as expected. The MaskCurrency widget has a lot of javascript. I don't have time to dive into that. But that is where you can focus your further analyse on.
Hi,
It will be helpful if you can share the oml.
Hi Krishnnambal
I added some extra clarity to the question. Perhaps that will help?
Hi Nicholas,
Let me know if these doesn't help, I'll might come up with some more suggestions using Google Dev tools. I see you can't share the app OML, but is it possible to replicate in a separate OML? Or possibly share your app's URL here (or personal message) so it can be checked on my browser.
Hi Ravi
Thank you for the suggestions. Let me look into what you've said and if I don't come right I will isolate that code into a separate OML as you suggested.
The suggestions have not worked for this particular situation. I will send a separate OML direct to you.
If your block has multiple input parameters, it can fire multiple OnParameterChange events, if the OnParameterChange event has logic that computes anything more than a few hundred milliseconds it quickly built up to a slow user experience.
You could try a solution I proposed a few years back, it is described here:
https://www.outsystems.com/forums/discussion/64124/onparameterschanged-issue/
Regards,
Daniel
Thanks Daniel
Thanks for the reply. I will have a look at that. I debugged and found that it was not running the OnParametersChanged multiple times even though in theory it should be - perhaps it is running it in the background but not showing in the debugger for some reason? If I debug, it runs the OnParametersChanged the first time, gets to the end and then once I pass the END node it freezes and then becomes normal again but does not run the OnParametersChanged again or any other action - I put a breakpoint on every action in the app and nothing was fired - unless there is JS on the InputMask Component running but I doubt it since I use that elsewhere and have never seen thus happen.
@Daniël Kuhlmann I had a look at that post and it seems similar but what's different is that the OnParemetersChanged seems to only be running one in my case as I said in the above message. I logged a message to the Console each time it ran to see if maybe it was the debugger just missing the following runs of the OnParametersChanged but it only writes one message and after that freezes and then goes back to normal - so I have no idea what it is running during that freeze time.
I have separated the functionality into an OML that I can share. Please let me know what you find Daniel and @Ravi Punjwani.I appreciate the assistance.
Hi Daniel
That was a good idea to do, kicking myself for not trying to eliminate that possibility. Thanks for doing that.
That is a pity as that is a lot harder to fix than a silly issue on my side. But will have to look into it and will chat with the asset owner.
Thanks again.