Skip to content

Step 3 of decompress-and-enqueue step is now invalid? #78

Description

@saschanaz

What is the issue with the Compression Standard?

https://compression.spec.whatwg.org/#decompress-and-enqueue-a-chunk

  1. If buffer is empty, return.

And then:

  1. If the end of the compressed input has been reached, and ds’s context has not fully consumed chunk, then throw a TypeError.

But this algorithm is called after the stream end is reached, step 3 would end the algorithm without throwing an error, making things invalid.

We missed this as Firefox has skipped step 3, as an empty buffer would void step 4 and 5 anyway.

Activity

  1. ricea commented on Oct 29, 2025

    @ricea
    Collaborator

    I suggest changing to

    3. If buffer is non-empty,
      1. Split
      2. Enqueue
    4. If the end ...
    

    Would you like to make a PR?

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions