validateAddParams() treated '' as falsy and rejected it with "Missing
required field 'data'" — so a legitimate empty file's first write always
failed. Only null/undefined data (with no vector either) is genuinely
absent; '' is real content. Fixed the check, plus the identical bug in
validateUpdateParams() (truncating a file to empty via overwrite hit the
same falsy check) and in update()/transact()'s update planner, where a
plain `Boolean(params.data)`/truthy check on the resolved vector would have
silently skipped both the deferred-embed marker and the eager re-embed for
an emptied value — a stale vector with no path to ever correct itself.
Verified end-to-end: vfs.writeFile('/empty.txt', '') now succeeds,
readFile() returns '', the file lists, and stat() reports size 0; the
existing "should reject empty string as data" tests (unit + integration)
asserted the old buggy behavior and are updated to assert the fixed
contract instead.
|
||
|---|---|---|
| .. | ||
| collation.test.ts | ||
| contentExtractor.test.ts | ||
| entity-id-mapper-stability.test.ts | ||
| entity-id-mapper-u32-ceiling.test.ts | ||
| indexReadiness.test.ts | ||
| memoryLimits.test.ts | ||
| metadataIndex-nested-orderby.test.ts | ||
| metadataIndex-sort-callshape.test.ts | ||
| metadataIndex-text-indexing.test.ts | ||
| metadataIndex-type-aware.test.ts | ||
| metadataIndex-watermark.test.ts | ||
| mutex.test.ts | ||
| osLimits.test.ts | ||
| paramValidation.test.ts | ||
| resultRanking.test.ts | ||
| roaring-bitmap-integration.test.ts | ||
| unifiedCache-eviction.test.ts | ||