POST /v1/goals allows creating duplicate goals for the same category
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 15
- Forks
- 14
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 16
Description
Bug: No uniqueness enforcement on goal creation
Environment: Pre-live (apis-prelive.quran.foundation)
Description
POST /auth/v1/goals?mushafId=<id> does not enforce uniqueness per user + category.
Sending a second POST with the same category returns a new id and creates a second
goal rather than returning a conflict error.
Steps to reproduce
POST /auth/v1/goals?mushafId=5with body:
{ "type": "QURAN_PAGES", "amount": 10, "category": "QURAN" }- Note the returned
id POST /auth/v1/goals?mushafId=5again with the same or differentamount- A different
idis returned — both goals now exist simultaneously
Expected
Second POST should return 409 Conflict if an active goal already exists
for that user and category.
Actual
A duplicate goal is created silently. Each POST succeeds with a new id.
Contributor guide
No contributing guide indexed for this repository
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 at the documented POST /auth/v1/goals?mushafId= entry point and locate the goal-creation implementation behind it; no source file or test is named in the issue. Reproduce the two requests described, then add or update coverage so an active goal for the same user and category makes the second request return 409 Conflict.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100