mafintosh / mafintosh/hyperlog
Remote nodes' values are Buffers
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 469
- Forks
- 20
- PR merge metrics
- No merged PRs in 30d
Description
Consider the following code:
log.on('add', function (node) {
console.log(node.value)
})
If the node was inserted locally, node.value will be the literal object that was added. If it was inserted and received remotely via replication, it will be a Buffer object that needs to be converted to a string and JSON.parse()d.
The encoding of the node's value ought to be consistent regardless of where it came from. I think we'll break somebody's code either way, so I'd be happier seeing it default to the former (raw value, not a buffer).
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 tracing the log.on('add') event and comparing how node.value is produced for locally inserted versus remotely replicated nodes. Confirm the desired representation from the issue, then add or update coverage for both paths so the value has the same raw-object form regardless of origin.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- distributed-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100