[Bug]: Duplicate project IDs in projects.json cause ambiguous project lookup
What happened?
Bug Description
Several entries in data/projects.json use duplicate project IDs.
Current duplicates:
- ID 8 appears twice
- ID 9 appears three times
- ID 10 appears twice
The application uses project IDs for project lookup via get_project_by_id(...).
Because IDs are not unique, only the first matching project is returned during lookup.
Steps to Reproduce
-
Open
data/projects.json -
Observe duplicate IDs:
- 8
- 9
- 10
-
Start the application
-
Navigate to:
/project/8
Expected Behavior
Each project should have a unique identifier and be individually accessible.
Actual Behavior
The first matching project is returned. Projects sharing the same ID become unreachable.
Impact
Affected routes may include:
/project/<id>/project/<id>/code/project/<id>/download
This can result in:
- Incorrect project detail pages
- Incorrect starter code downloads
- Recommendation links resolving to the wrong project
Suggested Fix
- Ensure all project IDs are unique.
- Add a dataset validation test that fails when duplicate IDs are present.
Example test:
ids = [project["id"] for project in projects]
assert len(ids) == len(set(ids))
### Steps to reproduce
1. Open `data/projects.json`.
2. Search for duplicate IDs:
- ID 8 appears twice
- ID 9 appears three times
- ID 10 appears twice
3. Start the application:
```bash
python app.py
### Expected behaviour
Each project should have a unique ID and be individually accessible through the project detail route.
### Area of the app affected
Project detail page
### Python version
Python 3.12.3
### Operating system
Ubuntu 24.04
### Relevant error output or logs
```shell
Before submitting
- [x] I searched existing issues and this has not been reported before.
- [x] I can reproduce this bug consistently with the steps above.
- [x] I am running the latest version of the main branch.
Thank you for opening your first issue in DevPath.
Please make sure to:
- Read CONTRIBUTING.md
- Wait for assignment before starting work
- Follow repository guidelines carefully
Happy contributing.
Hi, I am a GSSoC 2026 contributor and would like to work on this issue. Can I get it assigned to me?
Hi @komalharshita Mentor, I'm a registered GSSoC contributor. My local environment is fully configured and ready. Please assign this task to me!
@komalharshita if yu find the issue ready to be worked upon please assign it to me
Hi, I am a contributor under GSSoC'26 and would like to work on this issue. Could you please assign it to me?
Hi! I'd like to work on this issue under GSSoC 2026.
Approach: I'll deduplicate the project IDs in data/projects.json by assigning unique sequential IDs to the conflicting entries (IDs 8, 9, 10), then update get_project_by_id(...) in app.py to use a dictionary-based lookup for O(1) access and early error detection. Finally, I'll add a Pytest validation test that asserts all project IDs are unique to prevent regression.
I have experience with Python, Flask, and data validation. Please assign me this issue.
Hi @komalharshita, I reproduced this issue locally and identified the duplicate project IDs causing the conflict. I'd like to work on this issue under GSSoC 2026. Could you please assign it to me? Thank you!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions!
This issue was closed because it has been inactive for an extended period. If this issue is still relevant, feel free to reopen it or create a new one.