Page MenuHomePhabricator

ApiEchoNotifications deletes all notifications if passed notformat=text
Closed, ResolvedPublic

Description

If notformat=text is passed to ApiEchoNotifications, it deletes all notifications instead of returning any of them. It does not seem that this is reversible without directly editing the database.

It looks like rECHOcf7100963849: Remove deprecated formatter removed the "legacy" formatter that notformat=text was attempting to use, causing formatting to just fail, and rECHO6e2236db8109: Moderate notifications caused Echo to delete notifications that cannot be formatted.

The best thing may be to just remove the 'text' option if it's no longer supported.

Details

Related Gerrit Patches:

Event Timeline

Anomie created this task.Jan 21 2017, 3:28 AM
Restricted Application added a project: Collaboration-Team-Triage. · View Herald TranscriptJan 21 2017, 3:28 AM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 334133 had a related patch set uploaded (by Sbisson):
Remove 'text' as a valid notifications output format

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

Change 334133 merged by jenkins-bot:
Remove 'text' as a valid notifications output format

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

Anomie moved this task from Non-core-API stuff to Done on the MediaWiki-API board.Jan 27 2017, 6:59 PM

@SBisson

Checking in betalabs:
https://en.wikipedia.beta.wmflabs.org/w/api.php?action=query&meta=notifications&notformat=text, I got the following:

{
    "error": {
        "code": "unknown_notformat",
        "info": "Unrecognized value for parameter \"notformat\": text.",
        "*": "See https://en.wikipedia.beta.wmflabs.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes."
    },
    "servedby": "deployment-mediawiki05"
}

Whereas, 'flyout', /* @deprecated */ and 'html', /* @deprecated */ options provide some helpful information about the deprecated options along with displaying the list of notifications - checked at https://en.wikipedia.beta.wmflabs.org/w/api.php?action=query&meta=notifications&notformat=flyout:

-------
"\"notformat=flyout\" has been deprecated and will be removed soon. Use \"notformat=model\" to get the raw data or \"notformat=special\" for pre-rendered HTML."
        }
    },
    "query": {
        "notifications": {
            "list": [
-----------------

Yep, 'flyout' and 'html' are deprecated but text was completely removed.

Etonkovidova added a comment.EditedJan 31 2017, 6:42 PM

QA recommendation: Resolve.

jmatazzoni closed this task as Resolved.Jan 31 2017, 6:54 PM