Bug Issue Form
Relevant source files
The following files were used as context for generating this wiki page:
The Bug Issue Form is a critical component of the TrackerBot ecosystem, designed to facilitate user-driven reporting of software defects and data inaccuracies. It functions as a public-facing web portal that bridges the gap between the TarkovTracker community and the project's GitHub repositories by automating the creation of GitHub issues from web submissions. Sources: README.md:10-14, AGENTS.md:7-10
This system is divided into two distinct reporting pathways: "Website Issues," which focus on application bugs and the web experience, and "Data Issues," which target incorrect quest data, item statistics, or maps. Both pathways are served by a dedicated Express.js web server (webserver.js) that handles validation, rate limiting, and GitHub API integration. Sources: webserver.js:145-197, web/index.html:10-33
Architecture and Data Flow
The Bug Issue Form architecture follows a client-server model where static HTML forms collect user input and submit it to an Express backend. The backend then processes the request and forwards it to the GitHub REST API.
Submission Process Flow
The following diagram illustrates the sequence of events from user input to issue creation on GitHub.
Frontend Implementation
The frontend consists of static HTML files located in the /web directory. Each form utilizes standard HTML5 validation and a JavaScript fetch call to transmit data. Sources: webserver.js:115, web/issue/index.html:70-98
Form Fields and Validation
The "Website Issue" form collects specific metadata required for developer triage:
- Title: A short summary of the problem.
- Discord Handle: User identification for follow-up.
- Description: Detailed steps to reproduce, expected results, and actual results.
- Honeypot: A hidden "Company" field used to trap automated spam bots.
Sources: web/issue/index.html:31-50
Technical Constraints (Client-Side)
| Feature | Implementation | Source |
|---|---|---|
| Method | Async fetch with application/json | web/issue/index.html:81-85 |
| Security | Honeypot field (hidden via CSS) | web/issue/index.html:43-46 |
| Feedback | Dynamic #issueStatus text updates | web/issue/index.html:65-68 |
Backend Processing (webserver.js)
The backend is responsible for enforcing security policies and formatting the payload for GitHub.
Security and Middleware
The server implements several layers of protection before accepting a submission:
- Rate Limiting: Independent quotas for
/dataand/issueendpoints (5 submissions per minute per IP). Sources: webserver.js:77-87 - Origin Validation: Checks the
originorrefererheaders against anALLOWED_ORIGINSallowlist to prevent unauthorized cross-site submissions. Sources: webserver.js:93-108 - Honeypot Enforcement: If the hidden
companyfield is populated, the server silently ignores the request but returns a success status to mislead the bot. Sources: webserver.js:122-124 - Field Truncation: Inputs are capped to prevent oversized payloads (e.g., Description is capped at 8,000 characters). Sources: webserver.js:62-73
GitHub Integration
The server uses the axios library to communicate with GitHub. It requires a GITHUB_TOKEN with repository write permissions.
| Configuration | Description | Env Variable |
|---|---|---|
| Auth | Bearer Token (token-based) | GITHUB_TOKEN |
| Dev Repo | Target for website bugs | REPO_DEV |
| Data Repo | Target for quest/item bugs | REPO_DATA_REPORT |
Sources: webserver.js:19-54
Data Sanitization Logic
function sanitizeReportFields({ title, discord, category, description, reference }) {
return {
title: truncate(title, MAX_TITLE),
discord: truncate(discord, MAX_DISCORD),
category: truncate(category, MAX_CATEGORY),
description: truncate(description, MAX_DESCRIPTION),
reference: reference ? truncate(reference, MAX_REFERENCE) : ""
};
}
Sources: webserver.js:126-134
Error Handling
The system is designed to fail gracefully without exposing sensitive credentials.
- API Errors: The
logSanitizedErrorfunction ensures that full Axios error objects (which might contain the rawGITHUB_TOKENin headers) are never logged to the console. Sources: webserver.js:199-207 - User Feedback: Errors during the
fetchprocess trigger a generic error message in the UI status box. Sources: web/issue/index.html:92-94
Summary
The Bug Issue Form system provides a streamlined, secure pipeline for community feedback. By offloading issue creation to a dedicated web server, the project maintains a clear separation between the Discord bot's interactive features and the administrative task of GitHub issue management. The combination of rate limiting, origin checks, and honeypots ensures the integrity of the project's issue trackers against spam and abuse. Sources: AGENTS.md:7-10, README.md:10-14