nusmodifications / nusmods

🏫 Official course planning platform for National University of Singapore.
https://nusmods.com
MIT License
587 stars 319 forks source link

Refreshing page resets all preferences and timetable #23

Closed lowjoel closed 10 years ago

lowjoel commented 10 years ago

Also affects closing the browser, and restoring the session. Probably something to do with routing.

thebengeu commented 10 years ago

Not seeing this, could you provide steps/platform to dupe please? Thanks!

lowjoel commented 10 years ago

FF30/Windows. @yangshun says Chrome works fine.

Load up the page. Fill in any number of modules in timetable builder. Refresh.

lowjoel commented 10 years ago

funny. it works on FF30/Ubuntu. Going to see if it's an addon messing with me.

yangshun commented 10 years ago

Lol don't use Windows :shit: (:

thebengeu commented 10 years ago

Strange, I've been testing with FF30 on Windows as well.

Could you try again? It's possible that the issue might have been fixed after updating the localForage library to 0.9.1.

Otherwise, is there any reason that IndexedDB might be disabled in your Windows setup? There's no convenient way to introspect IndexedDB in Firefox, but I could pass you some code.

lowjoel commented 10 years ago

I'm in School, FF30/Ubu. I'll try again when I get home.

lowjoel commented 10 years ago

This is nasty.

There's a script error (Firefox cryptically calls it an 'UnknownError') in main.js:7. It's obfuscated, so I can't figure out what might be the problem.

Themes get reset on page reload too. And all my modules appear in my timetable builder as white.

thebengeu commented 10 years ago

Does this occur in Firefox's Safe Mode as well?

lowjoel commented 10 years ago

Yup, it does. The plot thickens.

thebengeu commented 10 years ago

Ok I'm running the unminified version on http://nusmods.com:9000, could you see where the error is from there?

thebengeu commented 10 years ago

After a debugging session over Hangouts, conclusion was that IndexedDB somehow can't be used in that environment, by checking against http://www.html5rocks.com/en/tutorials/indexeddb/todo/. Can be semi-duplicated by going to about:config and setting dom.indexedDB.enabled to false.

Options to explore are patching localforage to detect this scenario and fallback to localStorage or just using localStorage.