nativescript-community / nativescript-community/ble

(android) startScanning unhandled rejection if user denies location permissions

Open
#265 0 comments 0 reactions 0 assignees View on GitHub

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.

https://github.com/nativescript-community/ble/blob/9820235506bea2bd27e82bc994cc512f6821b859/src/ble/index.android.ts#L1235-L1261

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.