nusmodifications / nusmodifications/nusmods
Deleted modules are not removed by validation
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 689
- Forks
- 364
- Avg merge
- 7h 5m
- Merged PRs (30d)
- 14
Description
Describe the bug
When a module added to the config is removed by the faculty, it is not fully removed by the validation logic
To Reproduce
Steps to reproduce the behavior:
- Run the following in devtools to simulate a deleted module
var timetablesObject = JSON.parse(localStorage.getItem("persist:timetables"));
timetablesObject["lessons"] = '{"2":{"BLABLABLA":{"Sectional Teaching":[17],"Tutorial":[14]}}}';
localStorage.setItem("persist:timetables", JSON.stringify(timetablesObject));
- The module remains in localStorage as
lessons:"{"2":{"BLABLABLA":0}}"
Expected behavior
While there are no user-facing errors, I think a better UX would be to inform the user that one of the module has been removed.
The stub should definitely be removed from the config, though.
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
Start by locating the validation logic that reads the lessons configuration and persists it in localStorage, then reproduce the issue with the provided devtools snippet. Done means a deleted module's stub is removed from the config; consider the issue's requested user-facing notification only if the existing validation flow supports it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100