nativescript-community / nativescript-community/ble
(android) startScanning unhandled rejection if user denies location permissions
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 202
- Forks
- 79
- PR merge metrics
- No merged PRs in 30d
Description
requestLocationPermission is passed a callback which is never invoked if the user denies permissions. If the user calls startScanning and this happens, the promise returned by startScanning never resolves as the callback is never invoked and no error is propagated to the user application.
startScanning needs to account for requestLocationPermission potentially rejecting and rethrow this error to the caller.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/ble/index.android.ts around lines 1235-1261 and trace how startScanning handles requestLocationPermission. Verify the denial path and ensure the returned promise rejects with the permission error; done means the caller receives an error instead of a pending promise.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, typescript
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100