Page MenuHomePhabricator

Replace usage of jquery.jStorage with the much smaller and more limited mediawiki.storage
Closed, ResolvedPublic

Description

We should do this asap.

  • Replace use of jquery.jStorage with mediawiki.storage
  • Migrate the existing values from jStorage to mediawiki.storage
  • Remove migration code in 15 days

Event Timeline

Restricted Application removed a project: Patch-For-Review. · View Herald TranscriptMay 25 2016, 8:01 PM
Restricted Application added a subscriber: Zppix. · View Herald Transcript

Change 288658 had a related patch set uploaded (by Jdlrobson):
Replace use of jStorage with mw.storage

https://gerrit.wikimedia.org/r/288658

Patch needs rebase, dependent patch has no bug associated.

Thanks for these patches

While working on this... something smells funny with mw.popups.getEnabledState and mw.popups.experiment.isUserInCondition.

The latter calls hasUserEnabledFeature and hasUserDisabledFeature which seem very similar to things happening in getEnabledState

Yes, I and Sam worked on two different patches at the same time thus came up with the duplicate functionality. We were eager to merge the EL patch, so refactoring was left for later.

Change 288658 merged by jenkins-bot:
Replace use of jStorage with mw.storage

https://gerrit.wikimedia.org/r/288658

phuedx closed this task as Resolved.EditedMay 31 2016, 10:12 AM

I've confirmed that this is done on our staging server.

I rolled the server back to feb0c76 and disabled the feature via the settings menu. I then rolled the server forward to 765aa40 and confirmed that:

  • the feature was still disabled
  • the "mwe-popups-enabled" key had been removed from the jStorage localStorage item
  • after removing the jStorage and jStorage_update items from localStorage, they were not re-created after reloading the page.

N.B. that if all keys have been deleted from jStorage, then the jStorage localStorage item isn't removed but is a non-empty string. Likewise, the jStorage_update remains so that the jStorage can perform its integrity check. Presumably, the cookie-based fallback provided by jStorage functions in the same way.

I assume that we'll deal with this if and when we completely remove jStorage from the MediaWiki codebase.

@phuedx how does resolviing this task work with the AC Remove migration code in 15 days?

Do we create a followup task for next sprint?

Do we create a followup task for next sprint?

I should've done that as part of sign off (read: yes, thank you).

@phuedx Did we finally remove the migration code or we missed creating the follow up? I don't remember.

@Jhernandez: Nope. The jQuery.jStorage shim is still there. It was added midway through May though so we'll be able to remove it without issue.

Change 305015 had a related patch set uploaded (by Phuedx):
Remove jQuery.jStorage shim

https://gerrit.wikimedia.org/r/305015

Change 305015 merged by jenkins-bot:
Remove jQuery.jStorage shim

https://gerrit.wikimedia.org/r/305015