Hello,
Server request time set to 1 second.However, logic continues after one second.I want to request timeout after 1 second while the server action logic is in progress.Is there a solution?
Client Action in Server Action's Properties
Server Action's Logic (Action to output the Network Latency BPS)
Hi Geon,
I made a mistake, before I used Network Information API for reactive app, and when I tried on mobile app, event with async process, it still failed. It seems there is compatible issue, as the Network Information API is also still on experimental stage.
So I created another demo, based on javascript doing download of an image.
Check this oml
Thanks
Hi,
I am little bit confused by your question.
First you set server request timeout to 1 second.
But you create the logic to take more than 1 second to complete.
Can you share more detail on what your intention with this process ?
Thank you for your response.
Because of the slowness of the mobile network
We have confirmed that the speed performance of the server action is affected.
So, before we start the server action of the main function
I want to get Latency BPS.
If the network is slow while importing BPS, it takes 2 seconds to 10 seconds if it is late,
If the time goes over 1 second, we'll process it as an offline with a time out exception
I'm trying not to proceed with the main server action.
Sorry if the sentences are unclear due to translation.
I kind get it what you want to achieve.
I have 2 suggestion, 1 is using your solution (but I think the other one is better)
If using your solution, then your button need to call Client action, where this client action will call Server action with the timeout 1 second, and have exception handler inside it.
By doing so, when the server reach timeout, the exception handler will capture it, and you can put your logic on the exception handler.
The second suggestion, by using javascript, Network Information API (https://developer.mozilla.org/en-US/docs/Web/API/NetworkInformation)
you can use either :
NetworkInformation.downlink
Returns the effective bandwidth estimate in megabits per second, rounded to the nearest multiple of 25 kilobits per seconds.
Returns the maximum downlink speed, in megabits per second (Mbps), for the underlying connection technology.
Based on this, you can put if the value below the threshold, you do the offline thing.
Thank you for your kind reply.
I will try the method you suggested.
hello. The first method you told me was the method I was using, and I tried the second method, but the speed value was retrieved normally from the browser, but an error occurred on the actual mobile phone. How can I solve this?..
Logic
Mobile App
Browser (Chrome / Outsystems Preview In Devices)
This is possibly because the API is javascript async, so you must doing async method to get the value.
I tried using various javascript async methods, but I kept getting an error message.
How should I write the syntax? Can you provide a demo?😢
Sorry I'm a beginner.
I can try to prepare a demo for you, but I cannot do it fast.
I'll get back to you after I created the demo.
thank you so much