Wikimedia

Migrate mobile editor to CSRF from edit token in TalkSectionAddOverlay

This task is about the MediaWiki extension called MobileFrontend. You can see it in action when you go to (for example) https://m.mediawiki.org/ instead of https://www.mediawiki.org/ (note the "m" instead of "www" in the URL).

  1. Make sure that the MobileFrontend extension is installed.
  2. Visit a mobile talk page (e.g., http://localhost:8080/wiki/User_talk:Stephen?debug=true#/talk on your local machine)
  3. Press "add discussion" at the bottom
  4. Enter some text
  5. Press "save"

The following warning is printed to the console of your web browser's developer tools:

Use of the "edit" token is deprecated. Use "csrf" instead.

(See the Phabricator task for the full output!)

You should migrate this code so it doesn't break unexpectedly when the old way (via an edit token) is no longer supported.

= Acceptance criteria for your patch:

  • Category, Talk and Edit overlays should make use of the csrf token rather than the edit token
  • We'll probably need to update tests and add tests for the CategoryGateway
  • Previous changes have introduced bugs so we'll want to simulate a few error and success cases to verify the change has been successful

You are expected to provide a patch in Wikimedia Gerrit. See https://www.mediawiki.org/wiki/Gerrit/Tutorial for how to set up Git and Gerrit.

Task tags

  • mobile-frontend
  • javascript

Students who completed this task

LukasA

Task type

  • code Code
close

2018