mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-15 03:44:02 +00:00
f7d98d7690
I think the issues in T329299 are caused by partially autosaved comments. We store data in multiple localStorage keys, and if some of them are stored but others are not (due to exceeding storage quota), our code can't handle the inconsistent state. We already have a wrapper around localStorage that tries to cover up these issues. Change it so that all values specific to an instance of a reply tool are stored under one localStorage key. This ensures that all updates consistently succeed or fail, with no partially stored state. One of the reasons we haven't done this is because this requires the whole data to be serialized to JSON every time, but our experience with VE change 4355d697aa shows that this is fast enough. Extra changes: * Remove storagePrefix, now redundant * Remove use of createConflictableStorage, now redundant * Prefix the key with 'mw' as advised by mw.storage documentation * Use ES6 syntax for the new code (just for fun) * Use consistent expiry (T339042) Bug: T329299 Change-Id: I347115f7187fd7d6afd9c6f368441e262154233b
37 lines
691 B
JSON
37 lines
691 B
JSON
{
|
|
"root": true,
|
|
"extends": [
|
|
"wikimedia/client",
|
|
"wikimedia/jquery",
|
|
"wikimedia/mediawiki"
|
|
],
|
|
"globals": {
|
|
"ve": "readonly",
|
|
"RangeFix": "readonly"
|
|
},
|
|
"rules": {
|
|
"no-implicit-globals": "off",
|
|
"no-var": "off",
|
|
"max-len": "off"
|
|
},
|
|
"settings": {
|
|
"polyfills": [
|
|
"URL",
|
|
"URLSearchParams"
|
|
],
|
|
"jsdoc": {
|
|
"preferredTypes": {
|
|
"CommentController": "CommentController",
|
|
"CommentDetails": "CommentDetails",
|
|
"CommentItem": "CommentItem",
|
|
"DmMWPingNode": "DmMWPingNode",
|
|
"HeadingItem": "HeadingItem",
|
|
"MemoryStorage": "MemoryStorage",
|
|
"moment": "moment",
|
|
"ThreadItemSet": "ThreadItemSet",
|
|
"ThreadItem": "ThreadItem"
|
|
}
|
|
}
|
|
}
|
|
}
|