yacs.n
yacs.n copied to clipboard
Bug — Limited Size of Cookies
Describe the bug Since browsers have a 4096-byte limit for each cookie, if a user selected many courses that exceed the limit, courses will not be loaded after refreshing.
To Reproduce
- Log out.
- Select any 6 courses in Summer 2021
- Select any 6 courses in Fall 2021
- Select any courses in Spring 2022
- Refresh the page
- Some/All selected courses in Spring 2022 are missing.
Expected behavior The selected courses should be displayed.
Screenshots
Additional context It could be solved by optimizing the data structure of cookies, or switching to local storage, ~~or deleting the old selected courses when reaching the limit~~. However, this is not a significant issue if the cookie expires before the new registration.
@Viyerelu23333 I am assuming you found this while logged out? Course storage while logged in should be in the database not cookies so this shouldn't be a problem there.
More on topic, EDIT: I believe we discussed when courses were added back to cookies that there should be a better way to do it, but we weren't sure how. I believe we are already storing them efficiently (unless you wanted to have each semester's courses be it's own cookie 🤔). The solution would either be to limit the number of courses that can be stored overall and prompt users to sign-in once they reach it. Or find a better way to store logged-out saved courses.
I am assuming you found this while logged out? Course storage while logged in should be in the database not cookies so this shouldn't be a problem there.
More on topic, EDIT: I believe we discussed when courses were added back to cookies that there should be a better way to do it, but we weren't sure how. I believe we are already storing them efficiently (unless you wanted to have each semester's courses be it's own cookie 🤔). The solution would either be to limit the number of courses that can be stored overall and prompt users to sign-in once they reach it. Or find a better way to store logged-out saved courses.
Oh, I did not log in... The selectedCourses
data structure contains _getCourseIdentifier()
from YacsService
, which returns a relatively large chunk of data...
I am still looking at the mechanisms of loading courses.