SciCatProject / SciCatProject/backend

Move History to its own collection

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

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
27
Forks
37
Avg merge
17h 32m
Merged PRs (30d)
38

Description

Move History information to its own collection

Summary

Currently each item has its history embedded in itself. If the item is modified multiple times, which might happen due to the data curation process, the number of entries under the history property can grow and use a considerable amount of the 165Mb of the allowed size for the mongodb document.
That might cause race condition when the item is already big and a new update is performed, resulting in a failed update.

Current Behaviour

History is embedded in each documents

Expected Behaviour

Each history item should be stored in the History collection. One entry per update and reference the item updated and the type

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

No files, tests, or entry points are identified in the issue. Start by tracing how item updates currently persist embedded history and how the History collection is modeled, then determine the references and update behavior needed. Done means each update creates a History entry linked to the item and history is no longer embedded without causing document-size or update-race failures.

Written by the indexing model from the issue text.

Assessment

Tech stack
mongodb, typescript
Domain
backend, database
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.