Patch for #4225 - #4271
Closed
zehata wants to merge 1 commit into
Closed
Conversation
…ble before state has been updated with lesson indices
|
@zehata is attempting to deploy a commit to the modsbot's projects Team on Vercel. A member of the Team first needs to authorize it. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4271 +/- ##
==========================================
+ Coverage 54.52% 56.58% +2.05%
==========================================
Files 274 297 +23
Lines 6076 6917 +841
Branches 1455 1667 +212
==========================================
+ Hits 3313 3914 +601
- Misses 2763 3003 +240 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
zehata
marked this pull request as draft
December 17, 2025 09:16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@leslieyip02 @jloh02 Patch for #4225, for the issue reported on the morning of 16 Dec by LH (https://t.me/NUSMods/13136)
Important Note: While this patch preserves the current behavior of the app, I think it is more prudent to add more error checking to the migration process, and to stop the migration if an error is encountered, because migrating the config is an inherently destructive process (it overwrites the old config).
I am currently working on that.This patch should be considered superseded by #4272When the app fetches the timetable modules, it populates the lesson indices which allows the migration of the module config to the new schema
nusmods/website/src/reducers/moduleBank.ts
Lines 47 to 60 in d31261e
The issue was caused by
nusmods/website/src/views/AppShell.tsx
Lines 64 to 66 in d31261e
calling
nusmods/website/src/actions/timetables.ts
Lines 231 to 239 in d31261e
When
validateTimetable(1)is called when the app successfully fetches the module data for semester 1, it callsmigrateTimetableConfigswhich migrates the configs for all semesters, including semester 2. Since the request for semester 2 has not returned, the lesson indices has not been populated for semester 2 (see point 1). Trying to migrate the config for semester 2 will thus fail.This patch fixes this issue by removing the
migrateTimetableConfigsfunction and instead migrates each semester's timetable config as data is fetched for each of the semester.