Skip to content

Content Delivery API's total property includes documents in the recycle bin #15792

@liamlaverty

Description

@liamlaverty

Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)

V13.1.1

Bug summary

In the Content Delivery API, when making requests to the PagedContent API endpoints, the returned object contains a property total. The total property includes all of the content published in the site and sometimes includes recently deleted content, until the examine index is rebuilt.

Specifics

http://localhost:59970/umbraco/delivery/api/v2/content?skip=0&take=10&fields=properties%5B%24all%5D

See screenshot attached. The total property counts 6 items, while the items array includes only 5 elements. The final unlisted array element is in the website's recycle bin.

image

Steps to reproduce

  • In a fresh Umbraco install, create a piece of content in the application
  • Query the endpoint /umbraco/delivery/api/v2/content?skip=0&take=10&fields=properties%5B%24all%5D
    • receive a result with total: 1, and an array of 1 items
  • Delete the piece of content from the application
  • Re-query the endpoint
    • receive a result with total: 1 and an array of 0 items
  • Rebuild the examine index, then re-query the endpoint
    • receive a result with total: 0 and an array of 0 items

Expected result / actual result

Expected result: the total to match the number of items available in the API

Actual result: the total matches the number of items in the Examine Index, which includes recently recycled items

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions