From 92ce064ebf0a7b9e40c7c73536198befa01b0f39 Mon Sep 17 00:00:00 2001 From: Chenlei Hu Date: Fri, 23 Aug 2024 13:52:53 -0400 Subject: [PATCH] Fix github request too long issue (#605) * Fix github request too long issue * Remove life on error message --- .../content/ExecutionErrorDialogContent.vue | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/components/dialog/content/ExecutionErrorDialogContent.vue b/src/components/dialog/content/ExecutionErrorDialogContent.vue index e96effed6..98f58a688 100644 --- a/src/components/dialog/content/ExecutionErrorDialogContent.vue +++ b/src/components/dialog/content/ExecutionErrorDialogContent.vue @@ -74,7 +74,8 @@ onMounted(async () => { }) const generateReport = (systemStats: SystemStats) => { - const MAX_JSON_LENGTH = 50000 + // The default JSON workflow has about 3000 characters. + const MAX_JSON_LENGTH = 20000 const workflowJSONString = JSON.stringify(app.graph.serialize()) const workflowText = workflowJSONString.length > MAX_JSON_LENGTH @@ -134,25 +135,26 @@ const copyReportToClipboard = async () => { toast.add({ severity: 'error', summary: 'Error', - detail: 'Failed to copy report', - life: 3000 + detail: 'Failed to copy report' }) } } else { toast.add({ severity: 'error', summary: 'Error', - detail: 'Clipboard API not supported in your browser', - life: 3000 + detail: 'Clipboard API not supported in your browser' }) } } -const openNewGithubIssue = () => { +const openNewGithubIssue = async () => { + await copyReportToClipboard() const issueTitle = encodeURIComponent( `[Bug]: ${props.error.exception_type} in ${props.error.node_type}` ) - const issueBody = encodeURIComponent(reportContent.value) + const issueBody = encodeURIComponent( + 'The report has been copied to the clipboard. Please paste it here.' + ) const url = `https://github.com/${repoOwner}/${repoName}/issues/new?title=${issueTitle}&body=${issueBody}` window.open(url, '_blank') }