telefonicaid / telefonicaid/iotagent-node-lib
retrieve one command when several commands are stored is based in findOne by name (no creationDate is used)
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 62
- Forks
- 90
- Avg merge
- 2h 35m
- Merged PRs (30d)
- 1
Description
Retrieve command is using findOne based on command name
https://github.com/telefonicaid/iotagent-node-lib/blob/e85304dd257addcfac0f9ceaddf8d1e9ddf82463/lib/services/commands/commandRegistryMongoDB.js#L44
When several commands with the same name are in the queue there is no policy about what command return.
Commands are stored by name and including creationDate
Maybe retrieve command using findOne should be based also in creationDate to return one command.
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 with lib/services/commands/commandRegistryMongoDB.js around line 44 and lib/model/Command.js around lines 27–35 to understand retrieval and the stored creationDate. Define the intended creationDate-based selection policy, then verify that retrieving duplicate command names follows it and add or update coverage in the existing command registry tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, mongodb
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100