EmotiBit / ofxEmotiBit

OpenFrameworks library and examples for the EmotiBit
MIT License
34 stars 8 forks source link

Spurious behavior for software version check on networks without internet access #194

Closed nitin710 closed 6 months ago

nitin710 commented 1 year ago

Describe the bug The EmotiBit Oscilloscope softwareVersionChecker shows different behaviors on different networks (without internet access)

To Reproduce Steps to reproduce the behavior:

  1. Connect to a network without internet access
  2. Open EmotiBit Oscilloscope

Expected behavior It should skip version checking if there is no internet access. (without any delay) image

nitin710 commented 1 year ago

A possible solution is to set a timeout period in the system call to curl. We don't currently have a timeout on curl, but we could implement it as a part of a new release.

On further debugging, it looks like there was a bug in curl wrt timeout.

This issue here raises a similar problem: https://github.com/curl/curl/issues/9272

which leads to the issue referenced in curl: https://github.com/curl/curl/pull/9147 (they have solved this in a later version of curl, that im using)

Using curl on an older version (currently installed as the primary version on my dev machine) gives this output 👇🏽 . Although there is 3 second timeout, i get the error message after around 11seconds. The timeout is ignored. image

However, when trying with the latest version on curl, v8.0.1 👇🏽 , i get the error message exactly after the timeout period image

Looks like the bug on curl has been solved. But, since we cannot guarantee all EmotiBit users will have the same curl installation, we need to probably add a timeout in Oscilloscope to not wait for curl "forever".