Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-47226

Unanswered Questions filter incorrectly queries for non-current content

XMLWordPrintable

      NOTE: This bug report is for Confluence Server. Using Confluence Cloud? See the corresponding bug report.

      There is a bug in ContentTypeQuestionRepository#getUnansweredQuestionIds whereby it neglects to add a predicate to the query to only return content with a status of `current`. ie. this code:

          .and(QUESTION.CONTENT_STATUS.eq(ContentEntityObject.CURRENT))
      

      This is a problem because the query is paged to return the first 20 unanswered Question IDs. The next step is to perform a subsequent query based on these IDs and then select the entire Question DTO for each matching ID. This subsequent query does filter out content that is not current, therefore it can unintentionally reduce the size of the resulting page of data.

      This results in the behaviour described in CQ-2325. The first 'page' of unanswered questions is accidentally filtered down to be less than 20 questions, which then prevents the 'show more' controls from displaying to view the next pages of content.

      This problem is exacerbated on Atlassian Answers because we have a large volume of content in the database with a status of `deleted` due to our anti-spam mechanisms.

              jclark@atlassian.com Joe Clark
              jclark@atlassian.com Joe Clark
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: