From eea0ee55ba680ff4b77e39646917aaa2215da617 Mon Sep 17 00:00:00 2001 From: Adam Setch Date: Thu, 10 Oct 2024 15:15:34 -0400 Subject: [PATCH 1/3] fix: discussions url Signed-off-by: Adam Setch --- src/renderer/utils/helpers.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/renderer/utils/helpers.ts b/src/renderer/utils/helpers.ts index 4014f56cd..0be1f2f47 100644 --- a/src/renderer/utils/helpers.ts +++ b/src/renderer/utils/helpers.ts @@ -123,6 +123,12 @@ export async function generateGitHubWebUrl( ): Promise { const url = new URL(notification.repository.html_url); + // FIXME: upstream API is returning broken API URLs for Discussion types + if (notification.subject.type === 'Discussion') { + notification.subject.url = null; + notification.subject.latest_comment_url = null; + } + try { if (notification.subject.latest_comment_url) { url.href = await getHtmlUrl( From 0a2cc8edd740e4431b59ff7269d82757aaf2d5a8 Mon Sep 17 00:00:00 2001 From: Adam Setch Date: Thu, 10 Oct 2024 15:19:51 -0400 Subject: [PATCH 2/3] fix: discussions url lookup Signed-off-by: Adam Setch --- src/renderer/utils/helpers.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/renderer/utils/helpers.ts b/src/renderer/utils/helpers.ts index 0be1f2f47..158a0458e 100644 --- a/src/renderer/utils/helpers.ts +++ b/src/renderer/utils/helpers.ts @@ -123,7 +123,8 @@ export async function generateGitHubWebUrl( ): Promise { const url = new URL(notification.repository.html_url); - // FIXME: upstream API is returning broken API URLs for Discussion types + // FIXME upstream GitHub API has started returning subject urls for Discussion notification types, + // however these URLs are broken. Temporarily downgrading to use discussion lookup process. if (notification.subject.type === 'Discussion') { notification.subject.url = null; notification.subject.latest_comment_url = null; From 56021f949aacfc6ce1d2c8a44237ce1688b043b9 Mon Sep 17 00:00:00 2001 From: Adam Setch Date: Fri, 11 Oct 2024 10:42:07 -0400 Subject: [PATCH 3/3] docs: add reference to open issue Signed-off-by: Adam Setch --- src/renderer/utils/helpers.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/renderer/utils/helpers.ts b/src/renderer/utils/helpers.ts index 158a0458e..e3b2a7bc1 100644 --- a/src/renderer/utils/helpers.ts +++ b/src/renderer/utils/helpers.ts @@ -123,7 +123,8 @@ export async function generateGitHubWebUrl( ): Promise { const url = new URL(notification.repository.html_url); - // FIXME upstream GitHub API has started returning subject urls for Discussion notification types, + // FIXME see #1583 + // Upstream GitHub API has started returning subject urls for Discussion notification types, // however these URLs are broken. Temporarily downgrading to use discussion lookup process. if (notification.subject.type === 'Discussion') { notification.subject.url = null;