fix: skip GitHub dedup for critical errors - #1503
Open
EttyKitty wants to merge 1 commit into
Open
Conversation
Critical errors close the game next frame, so the async GET paginated open-issue lookup never finishes and the report is lost. Discord already avoids this by sending a one-way POST without attaching save/log files. Mirror that behaviour for GitHub: when _error.critical is true, skip the dedup GET and POST the issue directly via createIssue.
Contributor
There was a problem hiding this comment.
2 issues found across 1 file
Confidence score: 5/5
scripts/GitHubBugReporter/GitHubBugReporter.gmlrepeats the same user-facing message, increasing maintenance noise without indicating a functional regression — extract it into a shared string macro or static constant.scripts/GitHubBugReporter/GitHubBugReporter.gmlduplicates issue creation and callback wiring already handled byfinalize, so future GitHub report changes could diverge — extract the shared create-and-handle flow.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="scripts/GitHubBugReporter/GitHubBugReporter.gml">
<violation number="1" location="scripts/GitHubBugReporter/GitHubBugReporter.gml:32">
P3: The critical path duplicates issue creation and callback wiring already maintained in `finalize`, so future changes to GitHub report handling must be applied twice and can diverge. Extract the shared create-and-handle operation into a helper and call it from both paths.</violation>
<violation number="2" location="scripts/GitHubBugReporter/GitHubBugReporter.gml:36">
P2: Custom agent: **Code Quality Review**
This added literal duplicates the same user-facing message at lines 156 and 166. Extract it into a shared string macro or static constant.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| if (_issue_critical != undefined) { | ||
| _issue_critical.setCallback(function(_result, _request) { | ||
| LOGGER.debug($"New issue created (critical, no dedup): #{_result.number}."); | ||
| show_message_async("Report sent to the Administratum."); |
Contributor
There was a problem hiding this comment.
P2: Custom agent: Code Quality Review
This added literal duplicates the same user-facing message at lines 156 and 166. Extract it into a shared string macro or static constant.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At scripts/GitHubBugReporter/GitHubBugReporter.gml, line 36:
<comment>This added literal duplicates the same user-facing message at lines 156 and 166. Extract it into a shared string macro or static constant.</comment>
<file context>
@@ -23,6 +23,24 @@ function GitHubBugReporter() constructor {
+ if (_issue_critical != undefined) {
+ _issue_critical.setCallback(function(_result, _request) {
+ LOGGER.debug($"New issue created (critical, no dedup): #{_result.number}.");
+ show_message_async("Report sent to the Administratum.");
+ }).setErrorback(function(_result, _request) {
+ LOGGER.error($"Failed to create issue (critical): {_result}");
</file context>
| if (_error.critical) { | ||
| var _body_critical = __build_body(_error, _user_text); | ||
| var _client_critical = new GitHub(_token); | ||
| var _issue_critical = _client_critical.createIssue(GITHUB_ISSUES_OWNER, GITHUB_ISSUES_REPO, new GitHubIssue(_error.report_title, _body_critical)); |
Contributor
There was a problem hiding this comment.
P3: The critical path duplicates issue creation and callback wiring already maintained in finalize, so future changes to GitHub report handling must be applied twice and can diverge. Extract the shared create-and-handle operation into a helper and call it from both paths.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At scripts/GitHubBugReporter/GitHubBugReporter.gml, line 32:
<comment>The critical path duplicates issue creation and callback wiring already maintained in `finalize`, so future changes to GitHub report handling must be applied twice and can diverge. Extract the shared create-and-handle operation into a helper and call it from both paths.</comment>
<file context>
@@ -23,6 +23,24 @@ function GitHubBugReporter() constructor {
+ if (_error.critical) {
+ var _body_critical = __build_body(_error, _user_text);
+ var _client_critical = new GitHub(_token);
+ var _issue_critical = _client_critical.createIssue(GITHUB_ISSUES_OWNER, GITHUB_ISSUES_REPO, new GitHubIssue(_error.report_title, _body_critical));
+ if (_issue_critical != undefined) {
+ _issue_critical.setCallback(function(_result, _request) {
</file context>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Critical errors close the game next frame, so the async GET paginated open-issue lookup never finishes and the report is lost. Discord already avoids this by sending a one-way POST without attaching save/log files. Mirror that behaviour for GitHub: when _error.critical is true, skip the dedup GET and POST the issue directly via createIssue.
Summary by cubic
Fixes critical-error GitHub bug reports being lost because the game closes next frame before the async dedup GET finishes.
Written for commit b3c409b. Summary will update on new commits.