max-mapper / max-mapper/concat-stream

New encoding auto-detection + streams2 change problem case

Open
#19 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
574
Forks
61
PR merge metrics
No merged PRs in 30d

Description

I'm not sure this is a big deal, but the encoding inference can cause issues when using objectMode streams and not specifying that the encoding is objects to concat-stream.

I found this in one of my tests when I updated this dependency:

var spigot = require("stream-spigot")
var concat = require("concat-stream")

spigot({objectMode: true}, [1, 2, 3, 4, 5])
  .pipe(concat(function (c) { console.log(c) }))

// <Buffer 31 32 33 34 35>

Using {encoding: "object"} fixes this, but where people may be relying on the auto-detection (e.g. legacy concat-stream invocations) they could end up in trouble.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the shown stream-spigot objectMode pipeline into concat-stream, then inspect the encoding auto-detection and concat callback entry points. Compare the default behavior with {encoding: "object"}; done means the object-mode case is handled correctly without breaking legacy concat-stream invocations.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
stream-processing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.