react-native-webrtc / react-native-webrtc/react-native-callkeep

getAudioRoutes definition returns Promise<void>, but should return Promise<AudioRoute[]>

Open
#748 0 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
1.1k
Forks
511
Avg merge
9h 12m
Merged PRs (30d)
2

Description

Bug report

  • I've checked the example to reproduce the issue.

  • Reproduced on:

  • Android

  • iOS

Above are essentially N/A, this is a definitions bug that is reflected in the code editor.

Description

index.d.ts currently lists getAudioRoutes() as returning Promise<void>. The readme suggests it should be returning Promise<AudioRoute[]>, correlated by the Java module.

Using getAudioRoutes thus requires a cast of getAudioRoutes() as unknown as Promise<AudioRoute[]> or similar.

The problematic line is located here:

https://github.com/react-native-webrtc/react-native-callkeep/blob/cc308ce2ed33bcc12ef1ef95468f4a81de7d6d4e/index.d.ts#L225

This appears to have been broken in this change: https://github.com/react-native-webrtc/react-native-callkeep/commit/0cba24edc969241dceee2ac2ea2817ceefe6d927#diff-7aa4473ede4abd9ec099e87fec67fd57afafaf39e05d493ab4533acc38547eb8

Steps to Reproduce

Use getAudioRoutes() in your code editor.

Versions

- Callkeep: 4.3.12
- React Native: N/A
- iOS: N/A
- Android: N/A
- Phone model: N/A 

Logs

N/A

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 at index.d.ts around line 225 and compare the declaration with the getAudioRoutes documentation and the referenced Java module. Confirm that the editor exposes the documented return type and verify the corrected definition in a TypeScript usage example.

Written by the indexing model from the issue text.

Assessment

Tech stack
react-native, typescript
Domain
mobile-dev
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.