typegoose / typegoose/mongodb-memory-server

Option to detect corrupted binary files

Open
#991 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.