Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Last Year's Course Data Displayed for Upcoming Year #31

Open
shfc opened this issue Dec 3, 2024 · 4 comments
Open

[Bug] Last Year's Course Data Displayed for Upcoming Year #31

shfc opened this issue Dec 3, 2024 · 4 comments
Labels
bug Something isn't working good first issue Good for newcomers priority:low

Comments

@shfc
Copy link

shfc commented Dec 3, 2024

Description of the Bug

The timetable incorrectly shows last year's course data when upgrading.

Reproduction Steps

Select a course for 2024. When the timetable is upgraded for 2025, the 2024 course data will be shown on the 2025 timetable.

Expected Behaviour

Only display the courses scheduled for 2025 on the 2025 timetable.

Additional Notes

image
@jsun969 jsun969 added bug Something isn't working priority:low good first issue Good for newcomers labels Dec 4, 2024
@phoenixpereira
Copy link
Member

@shfc We made some changes to the backend, and this should now be fixed. Can you please check on your end and verify this?

@shfc
Copy link
Author

shfc commented Dec 12, 2024

@shfc We made some changes to the backend, and this should now be fixed. Can you please check on your end and verify this?

Yes, there is no display on the timetable for that course now. I guess the backend deletes the course data and makes it inaccessible. But I believe this is a frontend bug. I think the frontend should do some defensive programming and display the course depending on its property value rather than its accessibility from API. As it hardcodes the timetable for 2025, it shouldn't display other years' courses, no matter if they are accessible. Happy to discuss this further!

@shfc shfc changed the title [Bug]Last Year's Course Data Displayed for Upcoming Year [Bug] Last Year's Course Data Displayed for Upcoming Year Dec 12, 2024
@phoenixpereira
Copy link
Member

Oh I see what you mean now, the issue is that the local storage had courses from 2024 that didn't get cleared when the year changed to 2025, so it still fetched and displayed them. To fix this, we would need to modify the code relating to local storage to also store the year for the timetable and clear the enrolled courses if the year changes.

@shfc
Copy link
Author

shfc commented Dec 12, 2024

Oh I see what you mean now, the issue is that the local storage had courses from 2024 that didn't get cleared when the year changed to 2025, so it still fetched and displayed them. To fix this, we would need to modify the code relating to local storage to also store the year for the timetable and clear the enrolled courses if the year changes.

Yes, this is what I mean. It is a good idea to clear the invalid courses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers priority:low
Projects
None yet
Development

No branches or pull requests

3 participants