feat: centralized error reporting → auto GitHub Issues
PHP (api/index.php): - reportError() endpoint (POST ?action=report_error): accepts source/type/message/stack/context/ua/version - _createOrCommentGithubIssue(): creates new issue OR adds comment on existing one (dedup by sha1 fingerprint via GitHub search API) - _appendErrorLog(): local data/error_reports.log fallback (500 KB rotation) - _phpErrorReport(): called by set_exception_handler + register_shutdown_function → catches all PHP fatals and uncaught exceptions - _githubRequest(): minimal curl-based GitHub REST v3 helper - Rate limit bucket: error_report (20 req/min) - Labels auto-created: auto-report, php-crash, js-error, kiosk-error, scale-error JS (assets/js/app.js): - reportError(payload): single POST to report_error, session-level dedup via _reportedFingerprints Set - window.onerror: reports uncaught-error with message+stack+location context - window.unhandledrejection: reports unhandled-promise with reason+stack - api(): reports api-server-error on HTTP 5xx responses Android Kiosk: - ErrorReporter.kt: singleton with init(context, serverUrl), report(Throwable), reportMessage(type, message) - Thread.setDefaultUncaughtExceptionHandler → catches ALL unhandled JVM crashes - Async executor (single thread), per-session fingerprint dedup, synchronous fallback for crash handler - doPost(): HttpURLConnection POST to /api/?action=report_error with device/version info - KioskActivity: ErrorReporter.init() in onCreate + finishWizard() - onReceivedError: reports webview-load-error with URL + error code - onConsoleMessage: reports webview-js-error for ERROR level console messages Config: GITHUB_ISSUE_TOKEN + GITHUB_REPO added to .env.example
This commit is contained in:
@@ -20,3 +20,11 @@ TTS_AUTH_TYPE=bearer
|
||||
TTS_CONTENT_TYPE=application/json
|
||||
TTS_PAYLOAD_KEY=message
|
||||
TTS_ENABLED=false
|
||||
|
||||
# GitHub Error Reporting (optional but recommended)
|
||||
# Creates GitHub Issues automatically on crashes/errors from app, kiosk and server.
|
||||
# Create a fine-grained PAT at https://github.com/settings/tokens?type=beta
|
||||
# → Only selected repos: EverShelf
|
||||
# → Permissions: Issues (Read+Write), Metadata (Read-only)
|
||||
GITHUB_ISSUE_TOKEN=
|
||||
GITHUB_REPO=dadaloop82/EverShelf
|
||||
|
||||
Reference in New Issue
Block a user