Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-68723

Comments are sorted and displayed incorrectly if they're created within the same second

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Low
    • None
    • 7.10.2
    • Issue - Comments
    • None

    Description

      Summary

      When an issue has enough comments to be collapsed, if there're comments created within the same second, they may be retrieved and displayed incorrectly by Jira.

      This bug has a similar concept to JSWSERVER-13996.

      Steps to reproduce

      So far this is only reproducible by using comment clone functions by 3rd-party add-ons e.g. Clone Plus for Jira or Backbone Issue Sync for Jira:

      1. Create an issue with 10+ comments
      2. Use add-on function to clone the comments to another issue
      3. View the issue where comments are cloned to

      Alternatively, manually edit the db to set the comment created values to the same second for all comments.

      Expected behavior

      Comments are retrieved and displayed correctly as they are in the original issue.

      Actual behavior

      A random comment may be missing whereas another random comment may be displayed twice.

      Cause

      This is caused by the way Jira retrieves comments from the database for the Comments tab when there're enough comments to be collapsed. Basically, Jira relies on the created column to sort the comments, and it assumes that there's a time gap (1 second+) between any 2 sequential comments. Due to the way comments are cloned using add-on, some comments might be written into the database having exactly the same created values (< 1 second difference), causing the comment sorting mechanism to break.

      Notes

      1. Without collapsing, the problem doesn't appear
        • Collapsing can be disabled by setting jira.comment.collapsing.minimum.hidden to 0 from Advanced Settings
      2. The problem never appears in All tab (as opposed to Comments tab)

      Workarounds

      1. Vendors to modify add-on code to ensure comments are not created within the same second
      2. Manually modify the db to set the comment created values to have at least a 1-second gap sequentially
      3. Disable comment collapsing as per the Notes section

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              vdung Andy Nguyen (Inactive)
              Votes:
              4 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated: