typegoose / typegoose/mongodb-memory-server
Option to detect corrupted binary files
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.8k
- Forks
- 191
- Avg merge
- 4h 25m
- Merged PRs (30d)
- 10
Description
As of MMS 11.1.0, we only checksum (which is the default) on download and after extraction, but we do no check the binaries again when trying to start them, leading to potentially corrupted binaries.
Example: let MMS download and extract it partially, kill the script and see that the file is corrupt (though that is not likely to be consistently reproducable). (re https://github.com/typegoose/mongodb-memory-server/issues/990#issuecomment-4525853881)
Implementation suggestions:
- store the checksum alongside the binaries (must be generated after extracting as checksum downloaded is for the entire archive)
- add a option to run a checksum on the binaries before each start
- add basic corrupt detection that does not rely on the checksum (like 0-size files or below a threshold of reasonable binary size)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the existing download, extraction, checksum, and MongoDB binary startup paths described in the issue. Review how archive checksums are handled, then define the stored post-extraction checksum and optional pre-start validation, including basic zero-size or undersized-file detection; done means corrupted binaries are detected before startup without relying only on the archive checksum.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100