RealDevSquad / RealDevSquad/website-backend
Multiple documents getting created in progresses collection
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 74
- Forks
- 276
- Avg merge
- 1d 26m
- Merged PRs (30d)
- 14
Description
Currently, our application has a business logic that checks if a progress document exists for the day before creating a new document in the in the progresses collection. However, we've noticed that if multiple requests are made in rapid succession within a single second, it can result in the creation of multiple progress documents for the same day. This is causing data duplication issues, and we need to address this to ensure that only a single progress document is created per day.
For e.g https://staging-api.realdevsquad.com/progresses?userId=iODXB6ns8jaZB9p0XlBw
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
No files or tests are named. Start by tracing the /progresses endpoint and the progress-document creation logic, then inspect how the progresses collection is queried and written. Done means rapid successive requests cannot create more than one progress document for the same user and day.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- api, backend, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100