From db4e36ad9bfc295f2d25f2a0264983ee35767631 Mon Sep 17 00:00:00 2001 From: Samantaz Fox Date: Wed, 25 Aug 2021 22:04:03 +0200 Subject: [PATCH 1/7] Add FAQ link to readme --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 5e3d3fdd..4e3c7a77 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,8 @@ Website  •  Instances list +  •  + FAQ  •  Documentation  •  From fa2c8f42b3d4c82455655f211f67150170911273 Mon Sep 17 00:00:00 2001 From: Samantaz Fox Date: Wed, 25 Aug 2021 22:13:17 +0200 Subject: [PATCH 2/7] Issue template: ask to read the FAQ --- .github/ISSUE_TEMPLATE/bug_report.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index c0485266..4c1a6330 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -7,9 +7,16 @@ assignees: '' --- - - - + + **Describe the bug** From a2600acfa9327ae7d1c01af2ccd5595f0617f5e0 Mon Sep 17 00:00:00 2001 From: Samantaz Fox Date: Tue, 2 Nov 2021 15:43:26 +0100 Subject: [PATCH 3/7] Improve crash page messages * Ask to read the FAQ and search for existing issues on Github * Include links to FAQ and directly to a new github issue * Github issue title is automatically based on exception name * Improved HTML * Minor languages changes --- locales/en-US.json | 7 ++++++- src/invidious/helpers/errors.cr | 35 ++++++++++++++++++++++++++++----- 2 files changed, 36 insertions(+), 6 deletions(-) diff --git a/locales/en-US.json b/locales/en-US.json index 91af3d72..55bbbdef 100644 --- a/locales/en-US.json +++ b/locales/en-US.json @@ -430,5 +430,10 @@ "user_created_playlists": "`x` created playlists", "user_saved_playlists": "`x` saved playlists", "Video unavailable": "Video unavailable", - "preferences_save_player_pos_label": "Save playback position: " + "preferences_save_player_pos_label": "Save playback position: ", + "crash_page_you_found_a_bug": "It looks like you found a bug in Invidious!", + "crash_page_before_reporting": "Before reporting a bug, make sure that you have:", + "crash_page_read_the_faq": "looked at the Frenquently Asked Queqtions (FAQ)", + "crash_page_search_issue": "searched for existing issues on Github", + "crash_page_report_issue": "If none of the above helped, please open a new issue on GitHub and include the following text in your message:" } diff --git a/src/invidious/helpers/errors.cr b/src/invidious/helpers/errors.cr index d10762c5..dbcc6068 100644 --- a/src/invidious/helpers/errors.cr +++ b/src/invidious/helpers/errors.cr @@ -26,19 +26,44 @@ def error_template_helper(env : HTTP::Server::Context, locale : String?, status_ if exception.is_a?(InfoException) return error_template_helper(env, locale, status_code, exception.message || "") end + env.response.content_type = "text/html" env.response.status_code = status_code - issue_template = %(Title: `#{exception.message} (#{exception.class})`) + + issue_title = "#{exception.message} (#{exception.class})" + + issue_template = %(Title: `#{issue_title}`) issue_template += %(\nDate: `#{Time::Format::ISO_8601_DATE_TIME.format(Time.utc)}`) issue_template += %(\nRoute: `#{env.request.resource}`) issue_template += %(\nVersion: `#{SOFTWARE["version"]} @ #{SOFTWARE["branch"]}`) # issue_template += github_details("Preferences", env.get("preferences").as(Preferences).to_pretty_json) issue_template += github_details("Backtrace", exception.inspect_with_backtrace) + + # URLs for the error message below + url_faq = "https://github.com/iv-org/documentation/blob/master/FAQ.md" + url_search_issues = "https://github.com/iv-org/invidious/issues" + + url_new_issue = "https://github.com/iv-org/invidious/issues/new" + url_new_issue += "?labels=bug&template=bug_report.md&title=" + url_new_issue += URI.encode_www_form("[Bug] " + issue_title) + error_message = <<-END_HTML - Looks like you've found a bug in Invidious. Please open a new issue - on GitHub - and include the following text in your message: -
#{issue_template}
+
+

#{translate(locale, "crash_page_you_found_a_bug")}

+

+ +

#{translate(locale, "crash_page_before_reporting")}

+
    +
  • #{translate(locale, "crash_page_read_the_faq", url_faq)}
  • +
  • #{translate(locale, "crash_page_search_issue", url_search_issues)}
  • +
+ +
+

#{translate(locale, "crash_page_report_issue", url_new_issue)}

+ + +
#{issue_template}
+
END_HTML next_steps = error_redirect_helper(env, locale) From fd30f5775af678e843ec8084c7b11f7d5e0e1ca9 Mon Sep 17 00:00:00 2001 From: Samantaz Fox Date: Tue, 2 Nov 2021 15:52:50 +0100 Subject: [PATCH 4/7] Add precisions to error message regarding locales --- locales/en-US.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locales/en-US.json b/locales/en-US.json index 55bbbdef..418798cc 100644 --- a/locales/en-US.json +++ b/locales/en-US.json @@ -435,5 +435,5 @@ "crash_page_before_reporting": "Before reporting a bug, make sure that you have:", "crash_page_read_the_faq": "looked at the Frenquently Asked Queqtions (FAQ)", "crash_page_search_issue": "searched for existing issues on Github", - "crash_page_report_issue": "If none of the above helped, please open a new issue on GitHub and include the following text in your message:" + "crash_page_report_issue": "If none of the above helped, please open a new issue on GitHub (preferably in English) and include the following text in your message (do NOT translate that text):" } From 34a79c5f1e54923caee8fbe8396f7b91228fa46e Mon Sep 17 00:00:00 2001 From: Samantaz Fox Date: Mon, 10 Jan 2022 22:01:12 +0100 Subject: [PATCH 5/7] Don't show "next steps" message with a stack trace Usually, next steps are after the error message. Here, we want the same options to be right above the stack trace, so users are less likely to report duplicates. --- locales/en-US.json | 2 ++ src/invidious/helpers/errors.cr | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/locales/en-US.json b/locales/en-US.json index 418798cc..9a2d3294 100644 --- a/locales/en-US.json +++ b/locales/en-US.json @@ -433,6 +433,8 @@ "preferences_save_player_pos_label": "Save playback position: ", "crash_page_you_found_a_bug": "It looks like you found a bug in Invidious!", "crash_page_before_reporting": "Before reporting a bug, make sure that you have:", + "crash_page_refresh": "Tried to refresh the page", + "crash_page_switch_instance": "Tried to use another instance", "crash_page_read_the_faq": "looked at the Frenquently Asked Queqtions (FAQ)", "crash_page_search_issue": "searched for existing issues on Github", "crash_page_report_issue": "If none of the above helped, please open a new issue on GitHub (preferably in English) and include the following text in your message (do NOT translate that text):" diff --git a/src/invidious/helpers/errors.cr b/src/invidious/helpers/errors.cr index dbcc6068..d441165d 100644 --- a/src/invidious/helpers/errors.cr +++ b/src/invidious/helpers/errors.cr @@ -43,6 +43,8 @@ def error_template_helper(env : HTTP::Server::Context, locale : String?, status_ url_faq = "https://github.com/iv-org/documentation/blob/master/FAQ.md" url_search_issues = "https://github.com/iv-org/invidious/issues" + url_switch = "https://redirect.invidious.io" + env.request.resource + url_new_issue = "https://github.com/iv-org/invidious/issues/new" url_new_issue += "?labels=bug&template=bug_report.md&title=" url_new_issue += URI.encode_www_form("[Bug] " + issue_title) @@ -52,8 +54,10 @@ def error_template_helper(env : HTTP::Server::Context, locale : String?, status_

#{translate(locale, "crash_page_you_found_a_bug")}



-

#{translate(locale, "crash_page_before_reporting")}

+

#{translate(locale, "crash_page_before_reporting")}

@@ -66,7 +70,9 @@ def error_template_helper(env : HTTP::Server::Context, locale : String?, status_ END_HTML - next_steps = error_redirect_helper(env, locale) + # Don't show the usual "next steps" widget. The same options are + # proposed above the error message, just worded differently. + next_steps = "" return templated "error" end From 2d1f6128be866b6155c263c8f6c1bfd438b50b50 Mon Sep 17 00:00:00 2001 From: Samantaz Fox Date: Mon, 17 Jan 2022 21:27:52 +0100 Subject: [PATCH 6/7] Fix typo in "crash_page_read_the_faq" Co-authored-by: Matthew McGarvey --- locales/en-US.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locales/en-US.json b/locales/en-US.json index 9a2d3294..67156f14 100644 --- a/locales/en-US.json +++ b/locales/en-US.json @@ -435,7 +435,7 @@ "crash_page_before_reporting": "Before reporting a bug, make sure that you have:", "crash_page_refresh": "Tried to refresh the page", "crash_page_switch_instance": "Tried to use another instance", - "crash_page_read_the_faq": "looked at the Frenquently Asked Queqtions (FAQ)", + "crash_page_read_the_faq": "looked at the Frenquently Asked Questions (FAQ)", "crash_page_search_issue": "searched for existing issues on Github", "crash_page_report_issue": "If none of the above helped, please open a new issue on GitHub (preferably in English) and include the following text in your message (do NOT translate that text):" } From 8c2495a3999a2102d0a299cd491356ac8c005d8f Mon Sep 17 00:00:00 2001 From: Samantaz Fox Date: Mon, 17 Jan 2022 21:47:29 +0100 Subject: [PATCH 7/7] Apply suggestions from review --- locales/en-US.json | 6 +++--- src/invidious/helpers/errors.cr | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/locales/en-US.json b/locales/en-US.json index 67156f14..f733f7db 100644 --- a/locales/en-US.json +++ b/locales/en-US.json @@ -433,9 +433,9 @@ "preferences_save_player_pos_label": "Save playback position: ", "crash_page_you_found_a_bug": "It looks like you found a bug in Invidious!", "crash_page_before_reporting": "Before reporting a bug, make sure that you have:", - "crash_page_refresh": "Tried to refresh the page", - "crash_page_switch_instance": "Tried to use another instance", - "crash_page_read_the_faq": "looked at the Frenquently Asked Questions (FAQ)", + "crash_page_refresh": "tried to refresh the page", + "crash_page_switch_instance": "tried to use another instance", + "crash_page_read_the_faq": "read the Frenquently Asked Questions (FAQ)", "crash_page_search_issue": "searched for existing issues on Github", "crash_page_report_issue": "If none of the above helped, please open a new issue on GitHub (preferably in English) and include the following text in your message (do NOT translate that text):" } diff --git a/src/invidious/helpers/errors.cr b/src/invidious/helpers/errors.cr index d441165d..26c38669 100644 --- a/src/invidious/helpers/errors.cr +++ b/src/invidious/helpers/errors.cr @@ -56,8 +56,8 @@ def error_template_helper(env : HTTP::Server::Context, locale : String?, status_

#{translate(locale, "crash_page_before_reporting")}