Last modified: 2013-01-23 15:13:53 UTC
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.
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