Skip to content

Breaking change since v10.12.0 with zlib #28478

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.

Activity

  1. added
    zlibIssues and PRs related to the zlib module and its compression dependencies.
    regressionIssues related to regressions.
    on Jun 30, 2019
  2. changed the title [-]Breaking change in v10.12.0 with zlib[/-] [+]Breaking change since v10.12.0 with zlib[/+] on Jun 30, 2019
  3. addaleax commented on Jul 1, 2019

    @addaleax
    Member

    I’m not sure that this qualifies as a bug, but if you are sure that this is something that we should address, the easiest way would probably be to not use a global 0-sized Buffer to convey flushing information, but rather create one zero-sized Buffer per .flush() call and attach the desired flush flag to it as a property.

  4. addaleax commented on Jul 11, 2019

    @addaleax
    Member

    @mscdex Feel free to take a look at #28520 and let me know what you think here, it should fully address this issue

  5. added a commit that references this issue on Aug 13, 2019
  6. removed their assignment
    on Dec 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    regressionIssues related to regressions.zlibIssues and PRs related to the zlib module and its compression dependencies.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions