Open NovemLinguae opened 2 years ago
AFCH.userData.set
sets into both the localStorage and API useroptions. As it's a DOMException, clearly it has to do with the former. The localStorage can be full due to its use by other running javascripts.
The solution would be replace the raw localStorage calls with mw.storage
wrapper that swallows any exceptions. That being said, I don't see much need for localStorage being used at all, since the local AFCH.userData._optsCache and the API options should cover all bases.
When Star Mississippi uses AFCH, when declining drafts, he reports that he is often getting an
Uncaught DOMException: The quota has been exceeded.
error that prevents him from being able to decline the draft. Instead, AFCH hangs. The stack trace points to this line of code:https://github.com/WPAFC/afch-rewrite/blob/826153d3f1aa83bea5a9839fddfc7f3117143a1a/src/modules/submissions.js#L2405
More info: https://en.wikipedia.org/wiki/Wikipedia_talk:WikiProject_Articles_for_creation#Script_hanging
Googling indicates this may have something to do with running out of memory.
My step debugging doesn't indicate the declineCounts variable is very big though.
Stack trace: