breautek commented on issue #257:
URL: 
https://github.com/apache/cordova-plugin-geolocation/issues/257#issuecomment-2573287405

   The main thread refers to the main application event loop. This is often 
(and is the case for iOS apps) tied to the UI, so sometimes the main thread is 
also called the UI thread. Blocking the main thread will cause the UI to become 
unresponsive, and make the app feel laggy, or choppy. The geolocation API being 
used is being called on the main thread, and that API uses networking/gps 
hardware that can take a long time to complete, and has a risk of blocking the 
UI from updating, hence the warning.
   
   Additionally, iOS has a "watchdog" that monitors app's main threads and if 
they are blocked for  3-5 seconds ios can kill the app, causing an app crash, 
which is another reason why blocking the main thread is dangerous.
   
   I just had a glance at #283 and I think it's mislabeled. #283 wouldn't 
address this issue. It's changing code to explicitly reference `self` to make 
`self` retainment more obvious (because it's being used by an inner block of 
code.
   
   He has a different 
[commit](https://github.com/kumo01GitHub/cordova-plugin-geolocation/commit/ef045076bd6b696a244ece6d1fbf115b436a3f16)
 that looks like it would solve this issue by moving the offending code off the 
main thread, but I'm not sure if there is a PR created.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org

Reply via email to