Agontuk / react-native-geolocation-service

React native geolocation service for iOS and android
https://www.npmjs.com/package/react-native-geolocation-service
MIT License
1.6k stars 290 forks source link

Catch RuntimeException raised when calling invoke more than once on the same callback #338

Closed ananyosen closed 2 years ago

ananyosen commented 2 years ago

Summary

Catch RuntimeException raised when calling invoke more than once on the same callback

Fixes crashes when several requests are made simultaneously

Test Plan

Tested in production with current code, over ~2500 users, no changes in existing behavior, no crashes either

francois-pasquier commented 2 years ago

👋🏽 It's still happening on my end:

ERROR Invariant Violation: No callback found with cbID 7547 and callID 3773 for module <unknown>. Args: '[{"message":"Location request timed out.","code":3}]', js engine: hermes

ananyosen commented 2 years ago

👋🏽 It's still happening on my end:

ERROR Invariant Violation: No callback found with cbID 7547 and callID 3773 for module <unknown>. Args: '[{"message":"Location request timed out.","code":3}]', js engine: hermes

My bad, should've been more explicit. This fixes the RuntimeException when a callback has already been invoked

Agontuk commented 2 years ago

This should be fixed with latest changes in master branch, so closing this

tianzige666 commented 1 year ago

im using v5.3.1 still have this bug. v5.3.0 is same