Page MenuHomePhabricator

Wikibase Exception for wbformatvalue API call with type=unknown
Closed, ResolvedPublic5 Estimated Story Points

Description

If the wbformatvalue api is called with the string unknown for the type, then an Exception is thrown and an internal server error is logged. See the parent ticket for more information.

Acceptance criteria

  • Calling wbformatvalue with {"value":"123","type":"unknown"} results in the usual error response

Event Timeline

WMDE-leszek set the point value for this task to 5.Nov 20 2020, 11:59 AM

WikibaseRepo::getDataValueDeserializer() looks relevant, that defines 'unknown' => UnknownValue::class as, seemingly, a deserializable data type.

Change 643248 had a related patch set uploaded (by Rosalie Perside (WMDE); owner: Rosalie Perside (WMDE)):
[mediawiki/extensions/Wikibase@master] [WIP] Fix exception error message for wbformatvalue API call with type=unknown

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

Change 643735 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/Wikibase@master] WIP: Catch FormattingException in FormatSnakValue

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

Change 643248 abandoned by Rosalie Perside (WMDE):
[mediawiki/extensions/Wikibase@master] Fix exception error message for wbformatvalue API call with type=unknown

Reason:
better approach https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Wikibase/ /643735

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

Change 643735 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Catch FormattingException in FormatSnakValue

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