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 of import_batch (or BatchCallback) is incorrect #196

Open
utdemir opened this issue Mar 14, 2022 · 0 comments
Open

Type signature of import_batch (or BatchCallback) is incorrect #196

utdemir opened this issue Mar 14, 2022 · 0 comments

Comments

@utdemir
Copy link

utdemir commented Mar 14, 2022

Currently, import_batch is typed like this:

type BatchCallback = (errors: [Error] | undefined) => any;

import_batch(eventNames: string[], options?: BatchOptions, callback?: BatchCallback): void;
import_batch(eventNames: string[], callback?: BatchCallback): void;
import_batch(events: Event[], callback?: BatchCallback): void;

However, we've observed the case where the callback we passed to import_batch returned null, which is not a subtype of [Error] | undefined. I do not yet know whether we ever get undefined, but the type of the return value should contain null.

(Also, I'm not sure about this one, but reading through the codebase I have a suspicion that BatchCallback takes another results parameter which is not present in the type definition above)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant