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

      Summary

      Cannot save inline comment when the page has code block macro or in a table.

      Environment

      • Windows 10 Professional version 1607
      • Edge 38.14393.0.0 or later
      • Confluence 5.10.0 or later

      Steps to Reproduce

      Case 1:

      1. Create a page and add some text then save
      2. Try to add an inline comment then save it. It works
      3. Edit the page and add a code block macro in the middle of the page then save it
      4. Try to add an inline comment before the code clock and after (also the table)

      Case 2:

      1. Create a page and add some text then save
      2. Try to add an inline comment then save it. It works
      3. Edit the page and add a table in the middle of the page then save it
      4. Try to add an inline comment before the table, in the table and after it

      Expected Results

      The inline comment should be able to save wherever the text is selected

      Actual Results

      Can't save inline comment after the code block, in the table or after the code block or table. Error in the screen "Could not save the comment"

      Error appearers in the log

      2016-09-16 13:04:00,174 WARN [http-nio-8090-exec-25] [plugins.inlinecomments.service.InlineCommentServiceImpl] attemptInlineCommentCreateForPage The text selection is wrong
      – referer:  | url: /rest/inlinecomments/1.0/comments | traceId: 3d669b131184c2e7 | userName: admin
      com.atlassian.confluence.plugins.highlight.SelectionModificationException: The text selection is wrong
      at com.atlassian.confluence.plugins.highlight.service.SelectionValidator.validateSelection(SelectionValidator.java:65)
      at com.atlassian.confluence.plugins.highlight.service.SelectionValidator.validate(SelectionValidator.java:29)
      at com.atlassian.confluence.plugins.highlight.service.DefaultSelectionModifier.modify(DefaultSelectionModifier.java:46)
      at com.atlassian.confluence.plugins.highlight.DefaultSelectionStorageFormatModifier.markSelection(DefaultSelectionStorageFormatModifier.java:57)
      at sun.reflect.GeneratedMethodAccessor2691.invoke(Unknown Source)
      

          Form Name

            [CONFSERVER-43949] Cannot save inline comment with MS Edge

            Vinu added a comment -

            This seems to be the issue with Data Center enterprise version 6.13. Will this be back-ported for the enterprise version? As already noted this is affecting only edge.

            This also happens when you try to insert panels to your page. Anything on the panel and after that does not get an inline comment. 

            Vinu added a comment - This seems to be the issue with Data Center enterprise version 6.13. Will this be back-ported for the enterprise version? As already noted this is affecting only edge. This also happens when you try to insert panels to your page. Anything on the panel and after that does not get an inline comment. 

            No love for enterprise releases? This seems serious enough to warrant it.

            Nathanael Motz added a comment - No love for enterprise releases? This seems serious enough to warrant it.

            A fix for this issue is available to Server and Data Center customers in Confluence 6.15.4.

            Upgrade now or check out the Confluence 6.15 Release Notes to see what other issues are resolved.

            Maxim Leizerovich added a comment - A fix for this issue is available to Server and Data Center customers in Confluence 6.15.4. Upgrade now or check out the Confluence 6.15 Release Notes to see what other issues are resolved.

            Confluence 6.15.3 introduced an issue that meant some SVG icons, including all emoticons, don't display correctly in Confluence. To prevent more people being affected by this issue we decided to withdraw the release. Confluence 6.15.4 will be available soon with a fix for this Edge issue.

            Rachel Robins added a comment - Confluence 6.15.3 introduced an issue that meant some SVG icons, including all emoticons, don't display correctly in Confluence. To prevent more people being affected by this issue we decided to withdraw the release. Confluence 6.15.4 will be available soon with a fix for this Edge issue.

            A fix for this issue is available to Server and Data Center customers in Confluence 6.15.3
            Upgrade now or check out the Confluence 6.15 Release Notes to see what other issues are resolved.

            Maxim Leizerovich added a comment - A fix for this issue is available to Server and Data Center customers in Confluence 6.15.3 Upgrade now or check out the Confluence 6.15 Release Notes to see what other issues are resolved.

            PerOpel added a comment -

            Does this bug also affect version 6.12.1?

            PerOpel added a comment - Does this bug also affect version 6.12.1?

            Georg Deiters added a comment - - edited

            Atlassian suite, in my organization, is not among the set of tools only used rarely   ...  and having to select  your browser depending on your intended app is annoying. Thanks to akhaneev 's analysis, you almost have the code to fix it.

            Georg Deiters added a comment - - edited Atlassian suite, in my organization, is not among the set of tools only used rarely   ...  and having to select  your browser depending on your intended app is annoying. Thanks to akhaneev 's analysis, you almost have the code to fix it.

            Here are my insights on this issue:

            1. Can be reproduced, when there is some macro, that produce content, like Task Report macro, Table Filter macro, etc.
            2. It fails to add comments only in Edge, works fine in IE11, Chrome and Firefox.
            3. I compared inline comment requests made in Edge (fails)
              {"originalSelection":"beta","body":"<p>j</p>","matchIndex":-1,"numMatches":1,"serializedHighlights":"[[\"beta\",\"3:1:2:0:0:1:1:1:0\",0,4]]","authorDisplayName":"Admin","authorUserName":"admin","authorAvatarUrl":"/images/icons/profilepics/default.png","containerId":"1900560","parentCommentId":"0","lastFetchTime":"1541674810593","hasDeletePermission":true,"hasEditPermission":true,"hasResolvePermission":true,"resolveProperties":{"resolved":false,"resolvedTime":0},"deleted":false}

              and Chrome (works)

              {originalSelection: "beta", body: "<p>j</p>", matchIndex: 0, numMatches: 1,…}
              authorAvatarUrl: "/images/icons/profilepics/default.png"
              authorDisplayName: "Admin"
              authorUserName: "admin"
              body: "<p>j</p>"
              containerId: "1900560"
              deleted: false
              hasDeletePermission: true
              hasEditPermission: true
              hasResolvePermission: true
              lastFetchTime: "1541674573700"
              matchIndex: 0
              numMatches: 1
              originalSelection: "beta"
              parentCommentId: "0"
              resolveProperties: {resolved: false, resolvedTime: 0}
              serializedHighlights: "[["beta","3:1:2:0:0:1:1:1:0",0,4]]"

              and found the difference in those requests:

              Chrome:
              matchIndex: 0
              numMatches: 1
              Edge:
              "matchIndex":-1,"numMatches":1,

              This means that both browsers find only one match (numMatches: 1) for the selection on the page, but Chrome finds that the selected text is the first (matchIndex: 0) text snippet on the page among those found (numMatches: 1), and Edge says that there is no selected text (matchIndex: -1) on the page... but it says there is one match at the same time.

            Andrey Khaneev [StiltSoft] added a comment - Here are my insights on this issue: Can be reproduced, when there is some macro, that produce content, like Task Report macro, Table Filter macro, etc. It fails to add comments only in Edge, works fine in IE11, Chrome and Firefox. I compared inline comment requests made in Edge (fails) { "originalSelection" : "beta" , "body" : "<p>j</p>" , "matchIndex" :-1, "numMatches" :1, "serializedHighlights" : "[[\" beta\ ",\" 3:1:2:0:0:1:1:1:0\ ",0,4]]" , "authorDisplayName" : "Admin" , "authorUserName" : "admin" , "authorAvatarUrl" : "/images/icons/profilepics/ default .png" , "containerId" : "1900560" , "parentCommentId" : "0" , "lastFetchTime" : "1541674810593" , "hasDeletePermission" : true , "hasEditPermission" : true , "hasResolvePermission" : true , "resolveProperties" :{ "resolved" : false , "resolvedTime" :0}, "deleted" : false } and Chrome (works) {originalSelection: "beta" , body: "<p>j</p>" , matchIndex: 0, numMatches: 1,…} authorAvatarUrl:  "/images/icons/profilepics/ default .png" authorDisplayName:  "Admin" authorUserName:  "admin" body:  "<p>j</p>" containerId:  "1900560" deleted:  false hasDeletePermission:  true hasEditPermission:  true hasResolvePermission:  true lastFetchTime:  "1541674573700" matchIndex: 0 numMatches: 1 originalSelection:  "beta" parentCommentId:  "0" resolveProperties: {resolved: false , resolvedTime: 0} serializedHighlights:  "[[" beta "," 3:1:2:0:0:1:1:1:0 ",0,4]]" and found the difference in those requests: Chrome: matchIndex: 0 numMatches: 1 Edge: "matchIndex" :-1, "numMatches" :1, This means that both browsers find only one match (numMatches: 1) for the selection on the page, but Chrome finds that the selected text is the first (matchIndex: 0) text snippet on the page among those found (numMatches: 1), and Edge says that there is  no selected text  (matchIndex: -1) on the page... but it says there is one match at the same time.

            laurent added a comment -

            This is becoming really annoying!

            laurent added a comment - This is becoming really annoying!

            6.9.0 is also affected

            Mark de Bont [Marel] added a comment - 6.9.0 is also affected

              oshen@atlassian.com Oliver Shen
              oraissi Omar Raissi (Inactive)
              Affected customers:
              55 This affects my team
              Watchers:
              62 Start watching this issue

                Created:
                Updated:
                Resolved: