PollingController.startPollingByNetworkClientId does not type-check the given options
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 413
- Forks
- 308
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 253
Description
When calling `startPollingByNetworkClientId` in a controller that inherits from PollingController, it is possible to not pass any `options` or the wrong `options`, even if types are supplied for those `options` in that controller's `_executePoll`. Since `startPollingByNetworkClientId` is contained with PollingController, and PollingController has no awareness of what a subclass needs, all it can say is that the `options` are optional, and if they are supplied, they must be `Json`. The result of this is that if options are missing from `startPollingByNetworkClientId`, it can cause errors at runtime, which is not only undesirable because it goes against the purpose of using TypeScript, but also because it it is confusing to consumers.
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 by locating PollingController and the subclass _executePoll declarations, then trace how startPollingByNetworkClientId types its options. Determine how the controller can preserve the subclass's required options and add compile-time coverage for missing and incorrect options. Done means invalid calls are rejected while valid subclass calls remain type-safe.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- backend-api-design
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100