gitify: Discussion comment notification does not point to the comment.

🔍 Is there already an issue for your problem?

  • I have checked older issues, open and closed

📝 Description

If I click a gift notification by other commenter’s reply in a discussion, it doesn’t directly go to the comment. Instead it redirects me to Discussion tab page (i.e. https://<ghes-url>/<org>/<repo>/discussions). Which means I manually have to find out what exact discussion has a comment that notified me.

I found out that that it is because #discussioncomment-<sum-number> is missing in the gitify notification. When I click a notification in Github (GHES)'s Notification page, the link url is like

https://<ghes-url>/<org>/<repo>/discussions/15?notification_referrer_id=MDE4Ok5vdGlmaWNhdGlvblRocmVhZDE5NDQzNzEwOjk2OTAw#discussioncomment-13072

which redirects me to the correct comment.

BUT the same notification in gitify is missing the said #discussioncomment:

https://<ghes-url>/<org>/<repo>/discussions/15?notification_referrer_id=MDE4Ok5vdGlmaWNhdGlvblRocmVhZDE5NDQzNzEwOjk2OTAw

btw our corporate is using GitHub Enterprise Server 3.11.15.

🪜 Steps To Reproduce

(in GHES)

  1. Make another person to reply to any discussion that I am in the thread. Get ‘commented’ notification.
  2. Gitify notifies me, so click the notification.
  3. It drops me off at <org>/<repo>/<discussion> page, not to the specific discussion’s comment.

Gitify Version

5.16.2

Operating System

macOS

GitHub Account

GitHub Cloud

📸 Screenshots

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15 (8 by maintainers)

Most upvoted comments

After checking the graphQL query and its response, found that the issue is from GHES version; 3.11 does not have isAnswered field in discussion. It was added in 3.12.

Query

query fetchDiscussions($queryStatement: String!, $firstDiscussions: Int, $lastComments: Int, $lastReplies: Int) { 
  search(query: $queryStatement, type: DISCUSSION, first: $firstDiscussions) { 
    nodes { 
      ... on Discussion { 
        number 
        title 
        stateReason 
        isAnswered 
        url 
        author { 
          ...AuthorFields 
        } 
        comments(last: $lastComments) { 
          totalCount 
          nodes { 
            ...CommentFields 
            replies(last: $lastReplies) { 
              nodes { 
                ...CommentFields 
              } 
            } 
          } 
        } 
        labels { 
          nodes { 
            name 
          } 
        } 
      } 
    } 
  } 
} 
 
fragment AuthorFields on Actor { 
  login 
  url 
  avatar_url: avatarUrl 
  type: __typename 
} 
 
fragment CommentFields on DiscussionComment { 
  databaseId 
  createdAt 
  author { 
    ...AuthorFields 
  } 
} 

Response

{ 
    "errors": [ 
        { 
            "path": [ 
                "query fetchDiscussions", 
                "search", 
                "nodes", 
                "... on Discussion", 
                "isAnswered" 
            ], 
            "extensions": { 
                "code": "undefinedField", 
                "typeName": "Discussion", 
                "fieldName": "isAnswered" 
            }, 
            "locations": [ 
                { 
                    "line": 8, 
                    "column": 9 
                } 
            ], 
            "message": "Field 'isAnswered' doesn't exist on type 'Discussion'" 
        } 
    ] 
}

In the case of these PR discussion comments, it is notification.subject.type === 'PullRequest' though so this branch is not reached.

Ah, my misunderstanding - I hadn’t picked up that you were talking about PR replies… this issue has been about GitHub Discussion notifications.

I guess GitHub doesn’t return a latest_comment_url for PR review replies 🤔