Page MenuHomePhabricator

Not possible to add new statements with any Math properties
Closed, ResolvedPublic8 Estimated Story Points

Description

It seems it is currently not possible to add new statements with the math datatype. Because of some still unknown error, the js frontend is using {"value":"a + b","type":"unknown"} in its requests, both for wbformatvalue and wbsetclaim.

This might have started with -wmf.11, but it could also be that this is when T266493 started to happen.

Editing the value (in the existing statement) is not possible as well.

Reproducing the issue: edit https://test.wikidata.org/wiki/Q516#P717 and try to save the changed value. Observe the error preventing saving of the new value.

The reason seems to be this change:
T266496#6584787

Notes:

  • For local reproduction Math extension needs to be installed/enabled
  • It has been speculated the issue might have been related to some broken "wiring" of data types

Acceptance criteria

  • it is possible to add statements with the math data type again

Event Timeline

Michael created this task.Oct 26 2020, 6:01 PM
Michael updated the task description. (Show Details)Oct 26 2020, 6:16 PM
Addshore renamed this task from Not possible to add any Math properties to Not possible to add new statements with any Math properties.Oct 26 2020, 6:22 PM
Addshore added a subscriber: Addshore.
Physikerwelt triaged this task as High priority.Oct 27 2020, 10:22 AM
Physikerwelt moved this task from Incoming to Next-up on the Math board.Oct 27 2020, 6:07 PM
WMDE-leszek updated the task description. (Show Details)Oct 28 2020, 1:09 PM
WMDE-leszek updated the task description. (Show Details)
WMDE-leszek updated the task description. (Show Details)Oct 28 2020, 1:15 PM
WMDE-leszek set the point value for this task to 8.
hoo added a subscriber: hoo.Oct 28 2020, 1:51 PM

Poking around and git bisect point to 7f430f142d7f19cb575f0e665719619c9312ae57.

noarave updated the task description. (Show Details)Oct 28 2020, 1:55 PM
Addshore added a comment.EditedOct 29 2020, 6:46 PM

Comparing the request pattern for strings vs the math datatype highlights the issue.

String (parse then format)

https://test.wikidata.org/w/api.php?action=wbparsevalue&format=json&parser=string&values=23&errorformat=plaintext&uselang=en&options={"lang":"en"}
https://test.wikidata.org/w/api.php?action=wbformatvalue&format=json&datavalue={"value":"23","type":"string"}&generate=text/html; disposition=verbose-preview&property=P95180&errorformat=plaintext&uselang=en&options={"lang":"en"}

Math (only a format with the JS specifically stating the value is unknown as no parse has happened )

https://test.wikidata.org/w/api.php?action=wbformatvalue&format=json&datavalue={"value":"23","type":"unknown"}&generate=text/html; disposition=verbose-preview&property=P719&errorformat=plaintext&uselang=en&options={"lang":"en"}

I was debugging this issue. However, I don't know where to start searching for the problem I was looking at https://github.com/wikimedia/mediawiki-extensions-Math/blame/master/src/MathWikibaseHook.php. However, I was unable to identify the key difference between Math and all the other data types, that are still functional.

Physikerwelt moved this task from Next-up to Watching on the Math board.Fri, Nov 6, 12:10 PM

I tried testing it on https://test.wikidata.org/wiki/Q516#P717 and it still doesn't work. Is that expected because we have to wait for wmf-18?

In case it helps: I had been able again to add math values for some time last week, but now it fails again.

As @Lucas_Werkmeister_WMDE mentioned in mattermost, there seems to have been a regression in wmf.16 and we will need to backport the revert in T266671 back up. The permanent fix should be rolling out with wmf.18.

It probably makes sense to wait with verifying this until next week, so that we verify not just the backported revert (wmf.16) but also the proper fix (wmf.18).

Lydia_Pintscher closed this task as Resolved.Thu, Nov 19, 10:34 AM

Wikidata has wmf.18 now and it seems to work fine.
\o/