Page MenuHomePhabricator

API modules should report null-edits as such
Closed, ResolvedPublic

Description

Our API modules currently report null-edits as if they actually caused the entity to change (the result contains the new value). API modules could detect null edits by comparing the new revision ID reported by EditEntity (from EntityStore) with the base revision id. If they are the name, the edit did not have any effect. This should be reported by not including a ("new") value in the result, and possibly by providing a special flag ("unchanged" or some such).


Version: unspecified
Severity: normal
Whiteboard: u=dev c=backend p=
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=73257

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 3:48 AM
bzimport set Reference to bz73258.
bzimport added a subscriber: Unknown Object (MLST).
Lydia_Pintscher removed a subscriber: Unknown Object (MLST).
Lydia_Pintscher removed a subscriber: Unknown Object (MLST).

Change 236192 had a related patch set uploaded (by Ricordisamoa):
ResultBuilder: flag null edits with 'nochange'

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

Change 236192 merged by jenkins-bot:
ResultBuilder: flag null edits with 'nochange'

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

Example output before and after the patch:

 {
 	"entity": {
 		"labels": {
 			"en": {
 				"language": "en",
 				"removed": ""
 			}
 		},
 		"id": "Q26",
 		"type": "item",
-		"lastrevid": 1138
+		"lastrevid": 1138,
+		"nochange": ""
 	},
 	"success": 1
 }

Any further actions needed?

Addshore subscribed.

Nope, looks good!