Skip to main content
When a player discovers a bug in the Blockbuster game, the recommended workflow is to open a GitHub issue that describes the problem, includes a minimal reproduction or code snippet, and assigns relevant metadata (assignees, labels, projects, milestones). This guide demonstrates how a contributor reports the bug and how a repository owner configures notifications and assigns the issue. A contributor (Alice) finds a bug and is logged into the Blockbuster repository as the contributor “Alice”. She navigates to the Issues tab—there are currently no issues in this repository.
The image shows a GitHub repository named "block-buster" with files like .gitignore, README.md, index.html, script.js, and style.css. It includes details about the repository, indicating it's an enhanced version of a Brick Breaker game.
Step 1 — Create a new issue
  • Click New issue and provide a descriptive, concise title that summarizes the problem.
  • In the issue body, describe the bug, the expected behavior, and the steps to reproduce.
  • Include a small code snippet or example that demonstrates the root cause when applicable.
Example issue title used here: Exponential Ball Growth with Multiple Multi-Ball Power-Ups Causing Lag Alice documents the bug: collecting the multi-ball power-up twice in quick succession causes the number of balls to double each time, producing an excessive number of balls on screen and causing the game to lag. Markdown is supported in the issue body, so Alice pastes the JavaScript snippet she believes is responsible.
The image shows a GitHub page for creating a new issue in a repository, with a title entered and options for adding a description, assignees, labels, projects, and milestones.
Why this snippet causes exponential growth
  • The if test checks the current number of balls, but the code then iterates over gameState.balls and pushes clones into the same array while iterating.
  • Mutating the array during iteration (e.g., calling .push() on the array being iterated) can cause the loop to visit newly added items. This allows new clones to be iterated and cloned again, producing exponential growth when the power-up is activated multiple times.
Avoid mutating an array while iterating over it. Create a copy of the current items or build a separate list of new items, then append them after the iteration to prevent unexpected growth and performance issues.
Safer implementation
  • Build a separate array of clones first, then append them in one operation. Also consider enforcing a hard cap on the total number of balls to avoid FPS degradation.
This approach ensures:
  • The code does not mutate the array being iterated over.
  • Cloning and appending are separated, so the iteration is stable and predictable.
  • You can add a hard cap (for example: const MAX_BALLS = 10; gameState.balls.push(...clones.slice(0, MAX_BALLS - gameState.balls.length));) to prevent exceeding intended limits.
Issue metadata and workflow
  • After submitting the issue, Alice can set metadata: assign herself, add labels (e.g., bug, performance), and set projects or milestones to track the fix.
  • A repository owner or collaborator can triage the issue, assign it, and add additional labels or comments.
Recommended fields to set when creating or triaging an issue: Notifications and Watch settings
  • By default, GitHub notifies users when they are participating, mentioned, or when they create the issue themselves. Repository owners who want to receive notifications for all new issues must update their Watch settings to Custom and opt in for issues, pull requests, and discussions.
Tip: To be notified of all new issues in a repository, go to the repository page → Watch → Custom, and enable notifications for Issues. This ensures you don’t miss new reports from contributors.
Typical flow after an issue is created
  1. Contributor creates an issue, provides reproduction steps and a code snippet if available.
  2. Repository owner configures Watch → Custom to receive notifications for new issues.
  3. Owner assigns the issue to themselves or another collaborator for triage and resolution.
  4. Assigned owner receives a notification and begins work on the fix.
After assigning the issue, the owner receives a notification about the assignment.
The image shows a GitHub notifications page with a specific issue assigned, related to "Exponential ball growth with multiple Multi-Ball power-ups causes lag."
Links and references

Watch Video