Page MenuHomePhabricator

wbcreateclaim overwrites existing claims when revision ID is used
Closed, ResolvedPublic

Description

When adding more than one Claim, only the first one created will be there after reloading the page. The API calls are done successfully and two different Claim GUIDs are returned when creating two claims. This seems to be a backend error, probably related to the revision ID handling.


Version: unspecified
Severity: critical

Details

Reference
bz43200

Event Timeline

bzimport raised the priority of this task from to Unbreak Now!.Nov 22 2014, 12:52 AM
bzimport set Reference to bz43200.

Correction: Not the first Claim added will still be there after reload, it is the last one added.

I think the backend is already doing something with the revision ID we're sending in the request. But it seems to do the wrong thing. We're sending the base revision ID (the one we got when the site was loaded) each time a new statement or claim is created. The backend semms to not patch properly as only the newest created claim or statement is kept and all others are thrown away. If we send "0" as revision ID when creating a new claim or statement, everything works fine. I assume this case is handled differently in the backend.

I added a test to check for this bug: https://gerrit.wikimedia.org/r/39195

It's passing, so I cannot reproduce the issue.

Talked to Tobi. Issue occurs when making a request when an old rev id, which will cause claims in later revisions to be removed. This is likely a patching issue, and perhaps due to EntityDiff not containing claims (bug 43021).

Started work on cleaning up EntityDiff and its patching code https://gerrit.wikimedia.org/r/#/c/39229/

some more changes addressing this: I2b8fe753, Ifbdbfcc6, I2662bc13

Verified in Wikidata demo sprint 29