[wp-trac] [WordPress Trac] #44568: Two concurrent post deletes results in invalid return values

WordPress Trac noreply at wordpress.org
Wed Jul 11 12:29:42 UTC 2018


#44568: Two concurrent post deletes results in invalid return values
--------------------------+-----------------------------
 Reporter:  ajmccluskey   |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:
 Severity:  normal        |   Keywords:
  Focuses:  rest-api      |
--------------------------+-----------------------------
 === Steps to reproduce

 Using the REST API:

 * Create a post
 * Run two deletes for created post concurrently:
    1. Force delete (query params: `?force=true`)
    2. Delete without forcing (do not specify `force` query parameter)

 === Expected

 One delete to return `200 OK` and a valid return value. The other to
 return a `404 Not Found` or `410 Gone` depending on which one was
 successful.

 === Result

 1. Force delete returns `200 OK` and an empty post object (normally
 returns a JSON object including keys `deleted` and `previous`).
 2. Delete without force returns a post object full of `null` (see below)


 {{{#!json

 {
     "id": null,
     "date": "",
     "date_gmt": "",
     "guid": {
         "rendered": null,
         "raw": null
     },
     "modified": "",
     "modified_gmt": "",
     "password": null,
     "slug": null,
     "status": null,
     "type": null,
     "link": false,
     "title": {
         "raw": null,
         "rendered": ""
     },
     "content": {
         "raw": null,
         "rendered": "",
         "protected": false
     },
     "excerpt": {
         "raw": null,
         "rendered": "",
         "protected": false
     },
     "author": 0,
     "featured_media": 0,
     "comment_status": null,
     "ping_status": null,
     "sticky": false,
     "template": "",
     "format": "standard",
     "meta": [],
     "categories": [],
     "tags": [],
     "_links": {
         "self": [
             {
                 "href": "http:\\/\\/192.168.56.106\\/wp-
 json\\/wp\\/v2\\/posts\\/"
             }
         ],
         "collection": [
             {
                 "href": "http:\\/\\/192.168.56.106\\/wp-
 json\\/wp\\/v2\\/posts"
             }
         ],
         "about": [
             {
                 "href": "http:\\/\\/192.168.56.106\\/wp-
 json\\/wp\\/v2\\/types\\/post"
             }
         ],
         "wp:attachment": [
             {
                 "href": "http:\\/\\/192.168.56.106\\/wp-
 json\\/wp\\/v2\\/media"
             }
         ],
         "curies": [
             {
                 "name": "wp",
                 "href": "https:\\/\\/api.w.org\\/{rel}",
                 "templated": true
             }
         ]
     }
 }

 }}}

 === Notes

 * WordPress is latest release version at time of writing (4.9.7)
 * Server OS is Linux (running in a VM with fresh install)
 * Default theme is installed
 * Basic-Auth plugin is the only plugin installed -- required for testing

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/44568>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list