Addshore added a comment.

  So if I make subsequent requests to add the same statement It only makes and 
edit the first time. (using some api parameters that I whipped up which may not 
match what was being done in this ticket.
  See in ApiSandbox 
<https://test-commons.wikimedia.org/w/api.php?action=wbeditentity&format=json&id=M388&summary=Add%20a%20statement&token=XXX&data=%7B%0A%22claims%22%3A%20%7B%0A%22P95560%22%3A%20%5B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22mainsnak%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22snaktype%22%3A%20%22value%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22property%22%3A%20%22P95560%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22hash%22%3A%20%224730503cfb10069407f4cef2f2b4af8b162fab83%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22datavalue%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22value%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22entity-type%22%3A%20%22item%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22numeric-id%22%3A%2016597%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22id%22%3A%20%22Q16597%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22type%22%3A%20%22wikibase-entityid%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22type%22%3A%20%22statement%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22id%22%3A%20%22M388%247B743B1C-6B91-40FB-AB79-6469D76A4BCE%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22rank%22%3A%20%22normal%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%5D%0A%7D%0A%7D>
  Subsequent responses end up looking like this
  
    {
        "entity": {
            "labels": {},
            "descriptions": {},
            "claims": {
                "P95560": [
                    {
                        "mainsnak": {
                            "snaktype": "value",
                            "property": "P95560",
                            "hash": "a622e895bd403055234a24348a77a8125f7b3b0c",
                            "datavalue": {
                                "value": {
                                    "entity-type": "item",
                                    "numeric-id": 16597,
                                    "id": "Q16597"
                                },
                                "type": "wikibase-entityid"
                            },
                            "datatype": "wikibase-item"
                        },
                        "type": "statement",
                        "id": "M388$7B743B1C-6B91-40FB-AB79-6469D76A4BCE",
                        "rank": "normal"
                    }
                ]
            },
            "id": "M388",
            "type": "mediainfo",
            "lastrevid": 3220,
            "nochange": ""
        },
        "success": 1
    }
  
  This is also the behaviour that I observe when creating 2 statements in a 
single request.
  
  When passing a baserevid (used to detect and resolve edit conflicts if 
possible) I correctly see an edit conflict warning
  
    {
        "error": {
            "code": "editconflict",
            "info": "Edit conflict. Could not patch the current revision.",
            "messages": [
                {
                    "name": "wikibase-api-editconflict",
                    "parameters": [],
                    "html": {
                        "*": "Edit conflict. Could not patch the current 
revision."
                    }
                },
                {
                    "name": "edit-conflict",
                    "parameters": [],
                    "html": {
                        "*": "Edit conflict."
                    }
                }
            ],
            "*": "See https://test-commons.wikimedia.org/w/api.php for API 
usage. Subscribe to the mediawiki-api-announce mailing list at 
&lt;https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce&gt; for 
notice of API deprecations and breaking changes."
        },
        "servedby": "mw2297"
    }

TASK DETAIL
  https://phabricator.wikimedia.org/T263298

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Addshore
Cc: WMDE-leszek, CBogen, holger.knust, Ramsey-WMF, Addshore, DannyS712, 
Aklapper, Multichill, Akuckartz, darthmon_wmde, WDoranWMF, Nandana, 
Amorymeltzer, Lahi, Gq86, GoranSMilovanovic, Jayprakash12345, QZanden, 
LawExplorer, Sethakill, dg711, _jensen, rosalieper, Scott_WUaS, Wong128hk, 
Wikidata-bugs, aude, jayvdb, Anomie, Mbch331, Rxy, Legoktm
_______________________________________________
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to