{"record":{"id":"b3220984903ecc7e","repo":"oven-sh/bun","slug":"expected-receivedcount-0-to-equal-sentcount-b32209","errorCode":null,"errorMessage":"Expected ${receivedCount[0]} to equal ${sentCount}","messagePattern":"Expected (.+?) to equal (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"bench/postMessage/postMessage-string.mjs","lineNumber":73,"sourceCode":"  worker.postMessage(strings.small);\n});\n\nbench(\"postMessage(\" + fmt(strings.medium.length) + \" string)\", async () => {\n  sentCount++;\n  worker.postMessage(strings.medium);\n});\n\nbench(\"postMessage(\" + fmt(strings.large.length) + \" string)\", async () => {\n  sentCount++;\n  worker.postMessage(strings.large);\n});\n\nawait run();\n\nawait new Promise(resolve => setTimeout(resolve, 5000));\n\nif (receivedCount[0] !== sentCount) {\n  throw new Error(\"Expected \" + receivedCount[0] + \" to equal \" + sentCount);\n}\n\n// Cleanup worker\nworker?.terminate();\n","sourceCodeStart":55,"sourceCodeEnd":78,"githubUrl":"https://github.com/oven-sh/bun/blob/8c5296ac459e8252d3cd702f3fbcbb0c249d95d5/bench/postMessage/postMessage-string.mjs#L55-L78","documentation":"The bun.lockb header declares a total buffer size larger than the bytes actually present in the file - i.e. the lockfile is truncated (src/install/lockfile/bun.lockb.rs:429-431).","triggerScenarios":"An install was killed or crashed while rewriting bun.lockb; disk filled mid-save; a partial checkout/clone; git LFS or transfer mangling shortening the file.","commonSituations":"CI cancelled mid-install; laptops sleeping/crashing during install; incomplete git operations on the binary lockfile.","solutions":["Restore from version control: `git checkout -- bun.lockb`","Otherwise delete bun.lockb and `bun install` to rebuild it","Make sure installs complete and the disk has space before saving"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Let installs finish; avoid killing `bun install` while it saves the lockfile","Keep disk headroom so lockfile writes never truncate","If git LFS is in play, exclude bun.lockb from it"],"tags":["lockfile","truncation","corruption","install"],"backgroundTag":null,"analyzedSha":"8c5296ac459e8252d3cd702f3fbcbb0c249d95d5","analyzedAt":"2026-08-16T08:01:58.794Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}