Skip to content

Breaking change since v10.12.0 with zlib #28478

@mscdex

Description

@mscdex
  • Version: v10.12.0
  • Platform: n/a
  • Subsystem: zlib

In particular the breaking change occurred with #23186.

Before this change, code like:

compress.write(data);
compress.flush(Z_PARTIAL_FLUSH, () => {
  // do something with `compress.read();`
});
compress.write(data);
compress.flush(Z_PARTIAL_FLUSH, () => {
  // do something with `compress.read();`
});
compress.write(data);
compress.flush(Z_PARTIAL_FLUSH, () => {
  // do something with `compress.read();`
});
// etc. ...

would result in compress.read() returning only the compressed portion of data written before each flush().

After the change, node now seems to buffer the compressed contents of all of the write()s and passes that to one of the callbacks as one big chunk. This broke at least the ssh2-streams module, which depends on getting only the compressed data for particular chunks because of the need to include them in separate packets.

Metadata

Metadata

Assignees

No one assigned

    Labels

    regressionIssues related to regressions.zlibIssues and PRs related to the zlib subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions