github fergiemcdowall/search-index v6.0.2

4 hours ago

Fixed

Patch upgrades no longer invalidate existing indexes. Version validation
compared the full version string, so an index created with 6.0.0 was rejected
by 6.0.1 — every patch release orphaned users' on-disk data. It now compares
only MAJOR.MINOR, since patch releases do not change index topography.
(c053831)

DELETE no longer loses document-count updates. DOCUMENT_COUNT is
maintained as a read-modify-write, and PUT was serialized through the write
queue but DELETE was not — concurrent deletes (or a delete racing a put) could
drop increments and leave a permanently wrong count. DELETE now goes through
the same concurrency: 1 queue.
(9ff470b)

DOCUMENT_COUNT recovers from a corrupt or null value. NaN serialises
to null through the JSON value encoding, and a null count then poisoned
every subsequent increment. Missing, null, and non-numeric values now all read
as 0. The eager fire-and-forget count initialisation in the Writer
constructor is also gone — it raced the first PUT.
(7496388,
030e7b6)

Version-mismatch errors are now reachable. validateVersion previously
returned an Error rather than rejecting, so nothing surfaced it. It now
rejects, and the promise is exposed as SearchIndex.VERSION_VALIDATED. It also
tolerates abstract-level backends that throw on a missing key instead of
resolving undefined.
(c053831)

Browser test bundle crashed before running a single test. A DefinePlugin
entry keyed on process replaced every process reference in the test
bundle, defeating the process/browser.js shim. process.nextTick compiled to
void 0, and since browsers have no setImmediate, tape's stream helpers threw
TypeError: a is not a function while building the harness. Now scoped to
process.env.SI_TEST_ENTRYPOINT. Node-only, so test-node never caught it.
(ef09c52)

Changed

Important

Node.js 22 is now the minimum (engines.node: ">=22", previously the
stale ">=12"). Node 18 and 20 are no longer supported or tested.

Docs

  • Fixed "intantiated" typos in docs/API.md — thanks Espen Klem!
    (#632)

Don't miss a new search-index release

NewReleases is sending notifications on new releases.