Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type Signature Mismatch: getUserId() Function Returns void but Actually Returns userId #1240

Open
michaelschoenbaechler opened this issue Sep 26, 2023 · 0 comments
Assignees
Labels
type:defect Bugs or weaknesses. The issue has to contain steps to reproduce.

Comments

@michaelschoenbaechler
Copy link

Describe the bug

The getUserId() function in the BrowserTracker API returns void according to its type signature, even though the function behaves as expected and actually returns the userId.

To Reproduce

To reproduce this issue, you can look at the API definition for BrowserTracker. The getUserId() function is defined as:

getUserId: () => void;

Expected behavior

I would expect the getUserId() function's type signature to reflect its actual behavior by specifying a return type of string, like so:

getUserId: () => string;

Additional context

While the function itself returns the userId as expected when called, the type signature incorrectly indicates a void return type. This discrepancy could lead to confusion and potential type errors in code that relies on this API.

@michaelschoenbaechler michaelschoenbaechler added the type:defect Bugs or weaknesses. The issue has to contain steps to reproduce. label Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:defect Bugs or weaknesses. The issue has to contain steps to reproduce.
Projects
None yet
Development

No branches or pull requests

2 participants