Closed ahmed-safari closed 3 years ago
@Sp0derDev you might want to try safeMode. It checks the state before making a request to the browser instance
https://docs.openwa.dev/interfaces/configobject.html#safemode
I tried it, it still doesn't work most of the time. It keeps trying to send.
@github-actions run
Thank you, do you mind helping with implementing a timeout ?
@Sp0derDev CI server got stuck on the release, going to try fixing then will explain how to do it
#1153
#1155
#1154
#1156
#1157
#1174
#1163
#1166
#1169
#1170
#1171
034a9a7
callTimeout
#1152 1c11b16
PageEvaluateionTimeout
#1152 3a4a9c4
forceRefocus()
documentation f6b5ca8
popup
socket dependency to 3.0.4
a8b5f84
7617277
@Sp0derDev Ok. In the latest version (3.1.8) there are two major changes that will help you out.
safeMode
now forces an update to the state of the connection. If it is connected, it will resolve quickly and result in CONNECTED
and continue with the desired command. If there are issues with the connection between the device and the session then it will resolve in about 6 seconds and throw a confirmed TIMEOUT
state message (or some other undesirable state).
You can now set callTimeout
in the config (docs). This is the number of milliseconds the client method will wait before timing out. It will throw a PageEvaluateionTimeout
error with a generic message. This should free up your process to continue doing other things. Just because you got this error, it does not mean that the desired command failed. It just means your process is no longer waiting for a response so please be careful when using this as some consecutive commands may rely on the resolved value.
I'm sure there will be some teething problems that will need further patches so please report with any feedback/issues. Or just report back if it is working as expected for you so I can close this issue.
Thanks
Closing for now, please report back if there are any further issues. Thanks
When device is not connected, send functions doesn't return until it is connected again. It waits for an infinite amount of time. Is there a way around this?