The UI does not allow creating multiple comments at the same diff location, but instead encourages contributing to the comment threads already at a location. The uniqueness of thread locations was leveraged to simplify the collection of comments into threads by mapping their locations to keys. However, the REST API does permit multiple threads starting from the same diff location, so this expectation in the key-based UI threading logic can be wrong. In such scenarios, an unresolved thread may be mistakenly inserted into a resolved thread, resulting in a comment that is not resolvable through the UI. With this change, the `getCommentThreads` method is updated to associate comments into threads via the `in_reply_to` graph rather than location map in the same way that the `unresolved_comment_count` detail property is determined server-side. Although this corrects the issue in the `getCommentThreads` method, as of this change, the diffs do not yet use it to thread comments. Migrating diffs over to use it will be done in follow-up. Bug: Issue 6779 Change-Id: I9427ccc716acdf7ef4c63eba48d2287875fa5534
21 KiB
21 KiB