Last modified: 2014-01-22 15:34:37 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T59754, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 57754 - API: action=wbeditentity&clear=true with baserevid set doesn't throw conflicts when the existing entity has been edited
API: action=wbeditentity&clear=true with baserevid set doesn't throw conflict...
Status: VERIFIED FIXED
Product: MediaWiki extensions
Classification: Unclassified
WikidataRepo (Other open bugs)
unspecified
All All
: Unprioritized normal (vote)
: ---
Assigned To: Wikidata bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-29 18:23 UTC by Liangent
Modified: 2014-01-22 15:34 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Liangent 2013-11-29 18:23:56 UTC
action=wbeditentity&clear=true call with baserevid set should express that "I have looked at revision XXX and if now it's still like what I've seen, clear everything and use my data to replace the existing one". However, it's not the case in reality and even caused claims to be duplicated (it seems 'clear' is not performed): https://www.wikidata.org/w/index.php?title=Q1805224&diff=89778591&oldid=89777433
Comment 1 Liangent 2013-11-29 18:42:49 UTC
Repro:

== Query 1: Create a new claim, at Q245 ==

token=XXX&data=%7B%7D&new=item

{
    "entity": {
        "labels": [],
        "descriptions": [],
        "aliases": [],
        "sitelinks": [],
        "claims": [],
        "id": "Q245",
        "type": "item",
        "lastrevid": 2588
    },
    "success": 1
}

== Query 2: Create initial revision 2589 ==

id=Q245&token=XXX&data=%7B%22labels%22%3A%5B%7B%22language%22%3A%22en%22%2C%22value%22%3A%22Foo%22%7D%5D%2C%22claims%22%3A%7B%22P55%22%3A%5B%7B%22mainsnak%22%3A%7B%22snaktype%22%3A%22value%22%2C%22property%22%3A%22P55%22%2C%22datavalue%22%3A%20%7B%22value%22%3A%20%22abc%22%2C%22type%22%3A%20%22string%22%7D%7D%2C%22type%22%3A%22statement%22%2C%22rank%22%3A%22normal%22%7D%5D%7D%7D

{
    "entity": {
        "labels": {
            "en": {
                "language": "en",
                "value": "Foo"
            }
        },
        "descriptions": [],
        "aliases": [],
        "sitelinks": [],
        "claims": {
            "P55": [
                {
                    "id": "Q245$0CF9E5D0-31CD-4019-86A8-CF5AAA1CD596",
                    "mainsnak": {
                        "snaktype": "value",
                        "property": "P55",
                        "datavalue": {
                            "value": "abc",
                            "type": "string"
                        }
                    },
                    "type": "statement",
                    "rank": "normal"
                }
            ]
        },
        "id": "Q245",
        "type": "item",
        "lastrevid": 2589
    },
    "success": 1
}

== Query 3: Attempt to rewrite the item to something ==

id=Q245&baserevid=2589&token=XXX&data=%7B%22labels%22%3A%5B%7B%22language%22%3A%22de%22%2C%22value%22%3A%22Bar%22%7D%5D%2C%22claims%22%3A%7B%22P55%22%3A%5B%7B%22mainsnak%22%3A%7B%22snaktype%22%3A%22value%22%2C%22property%22%3A%22P55%22%2C%22datavalue%22%3A%20%7B%22value%22%3A%20%22def%22%2C%22type%22%3A%20%22string%22%7D%7D%2C%22type%22%3A%22statement%22%2C%22rank%22%3A%22normal%22%7D%5D%7D%7D&clear=

{
    "entity": {
        "labels": {
            "de": {
                "language": "de",
                "value": "Bar"
            }
        },
        "descriptions": [],
        "aliases": [],
        "sitelinks": [],
        "claims": {
            "P55": [
                {
                    "id": "Q245$8424C010-5151-44B3-B00C-6F2E6EEE436B",
                    "mainsnak": {
                        "snaktype": "value",
                        "property": "P55",
                        "datavalue": {
                            "value": "def",
                            "type": "string"
                        }
                    },
                    "type": "statement",
                    "rank": "normal"
                }
            ]
        },
        "id": "Q245",
        "type": "item",
        "lastrevid": 2590
    },
    "success": 1
}

== Query 4: Simultaneous attempt to rewrite the item to something else based on revision 2589. This created https://test.wikidata.org/w/index.php?title=Q245&oldid=2591 as a mixed revision, and returned data contain "new" attempt only ==

id=Q245&baserevid=2589&token=XXX&data=%7B%22labels%22%3A%5B%7B%22language%22%3A%22nl%22%2C%22value%22%3A%22Bar%22%7D%5D%2C%22claims%22%3A%7B%22P55%22%3A%5B%7B%22mainsnak%22%3A%7B%22snaktype%22%3A%22value%22%2C%22property%22%3A%22P55%22%2C%22datavalue%22%3A%20%7B%22value%22%3A%20%22qwerty%22%2C%22type%22%3A%20%22string%22%7D%7D%2C%22type%22%3A%22statement%22%2C%22rank%22%3A%22normal%22%7D%5D%7D%7D&clear=

{
    "entity": {
        "labels": {
            "nl": {
                "language": "nl",
                "value": "Bar"
            }
        },
        "descriptions": [],
        "aliases": [],
        "sitelinks": [],
        "claims": {
            "P55": [
                {
                    "id": "Q245$31144320-3601-4B00-B733-7F1DC6245C65",
                    "mainsnak": {
                        "snaktype": "value",
                        "property": "P55",
                        "datavalue": {
                            "value": "qwerty",
                            "type": "string"
                        }
                    },
                    "type": "statement",
                    "rank": "normal"
                }
            ]
        },
        "id": "Q245",
        "type": "item",
        "lastrevid": 2591
    },
    "warnings": {
        "messages": {
            "0": {
                "name": "wikibase-self-conflict-patched",
                "type": "warning"
            },
            "html": {
                "*": "<p>Your edit was patched into the latest version, overriding some of your own intermediate changes.\n</p>"
            }
        }
    },
    "success": 1
}
Comment 2 Liangent 2013-11-29 18:46:16 UTC
The warning? I guess an action=wbeditentity&clear=true call can hardly be interpretted as a "patch".
Comment 3 Gerrit Notification Bot 2014-01-09 04:26:58 UTC
Change 98795 had a related patch set uploaded by Legoktm:
Die if wbeditentity tries to clear from old revid

https://gerrit.wikimedia.org/r/98795
Comment 4 Gerrit Notification Bot 2014-01-20 13:56:14 UTC
Change 98795 merged by jenkins-bot:
Die if wbeditentity tries to clear from old revid

https://gerrit.wikimedia.org/r/98795

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links