diff --git a/CHANGELOG.md b/CHANGELOG.md index 4441e63..53ffe45 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to this package will be documented in this file. +## [2.0.1] - 2023-08-28 +### Fixed: +- Fixed an issue in the pre-allocation algorithm handling partial messages. + ## [2.0.0] - 2023-07-05 ### Changed: - Changed the way allocations are handled when receiving a line over multiple chunks. Instead of concatenating buffers together as they are received, instead an exponential doubling capacity algorithm will be used to allocate buffers to which multiple chunks may be copied. The algorithm will double until the excess capacity allocated reaches 1MiB. At that point subsequent re-allocations will allocate at maximum 1MiB of extra capacity. diff --git a/example/eventsource-polyfill.js b/example/eventsource-polyfill.js index 151d1aa..63978a9 100644 --- a/example/eventsource-polyfill.js +++ b/example/eventsource-polyfill.js @@ -7514,7 +7514,7 @@ function EventSource (url, eventSourceInitDict) { sizeUsed = 0 } else if (pos > 0) { buf = buf.slice(pos) - sizeUsed = buf.length + sizeUsed = sizeUsed - pos } }) } diff --git a/package.json b/package.json index 2bb4b90..6b8c400 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "launchdarkly-eventsource", - "version": "2.0.0", + "version": "2.0.1", "description": "Fork of eventsource package - W3C compliant EventSource client for Node.js and browser (polyfill)", "keywords": [ "eventsource",