lsongdev / lsongdev/input-event
Side-effect on request() when registering multiple input-events
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 65
- Forks
- 22
- PR merge metrics
- No merged PRs in 30d
Description
I experience a side-effect on request() when registering multiple input-events. See the following code:
```
const InputEvent = require('input-event');
const request = require('request');
// Register the callback functions
const input0 = new InputEvent('/dev/input/event0');
const keyboard0 = new InputEvent.Keyboard(input0);
const input1 = new InputEvent('/dev/input/event1');
const keyboard1 = new InputEvent.Keyboard(input1);
console.log('start request()');
request.get('http://google.com', () => {
console.log('received result');
});
```
this leads to `start request()`, but then it hangs and `received result` is not reached.
if the `input1`/`keyboard1` lines are commented out, the `request()` call works as expected.
why does input-event have such side-effects? and how to avoid this?
Contributor guide
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 running the minimal reproduction from the issue with one and then two /dev/input/event devices, comparing the request.get callback behavior. Trace the input-event and request entry points involved in registering the two Keyboard instances, and consider the issue resolved when the cause of the hang and a verified fix or avoidance path are identified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, linux, node.js
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100