Page MenuHomePhabricator

Wikidata (wikibase) REST API throws 500 error on subsequent API call
Open, Needs TriagePublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Call the REST API to patch a statement (here: change rank), eg https://www.wikidata.org/w/rest.php/wikibase/v0/statements/Q42$F078E5B3-F9A8-480E-B7AC-D97778CBBEF9:
{
		  "patch": [
		    {
		      "op": "replace",
		      "path": "/rank",
		      "value": "preferred"
		    }
		  ],
		  "tags": [],
		  "bot": false,
		  "comment": "foo bar"
		}
  • Call the same API to patch another statement rank in the same item within ~1sec

(I am doing this on-wiki in Javascript)

What happens?:

  • First API call works, changes statement rank correctly
  • Second API call: 500 error

What should have happened instead?:

Both ranks are changed

Please note that if I re-run the exact same query after a few seconds, it works fine. Presumably some race condition?

Event Timeline

At least it should fail with an "edit conflict" error or something, but since the statements are different, I would expect both calls to succeed

Update: API response is {"code":"unexpected-error","message":"Unexpected error"} for the second call.