Skip to content

Contain WebAPI failures and signal portable restarts - #88

Draft
valzargaming wants to merge 1 commit into
mainfrom
fix/webapi-error-containment
Draft

valzargaming wants to merge 1 commit into
mainfrom
fix/webapi-error-containment

Conversation

@valzargaming

Copy link
Copy Markdown
Member

Summary

  • Keep the HTTP listener and Discord client alive when one request throws, rejects, or produces an invalid response. Return a generic HTTP 500 instead of scheduling a whole-bot restart.
  • Log the underlying exception chain and method/path context at the request boundary. Omit request queries, headers, bodies and trace arguments; redact known keys and common credential forms. React error events retain cause-chain diagnostics without assuming a second request argument.
  • Make intentional portable restarts publish the supervisor's one-use reload marker before shutdown. Preserve stop precedence, suppress repeated requests, reject alternate entrypoints, and leave the bot running if the marker cannot be written.
  • Add offline regression tests to the existing Windows/Linux PHP 8.3–8.5 matrix.

Verification

Fresh installation from the committed Composer lock, with plugins and scripts disabled, on Windows/PHP 8.5.12.

Passed:

  • New WebAPI regression: sync, async and delayed rejection; invalid response; actual router catch; exception chains; credential/query/trace redaction; broken logger; real React HTTP parser with injected transport; subsequent request survives malformed-body and handler failures.
  • New portable restart regression: marker-before-stop ordering, one-use intent, duplicate suppression, stop precedence, entrypoint rejection, marker failure and retry. Network and process functions disabled for both new suites.
  • 16 targeted suites total, including existing HTTP dependency/handler safety, local library/profile/restart, portable startup/process/constructor/readiness, OOC, game-ready and calendar contracts.
  • Full source PHP lint, changed-file lint, Composer validation/platform requirements/audit, and git diff checks. Composer reports no vulnerability advisories.

Existing Handler dependency deprecation warnings remain on PHP 8.5. Hosted CI is pending. No production bootstrap, live Discord/game actions, deployment, or live supervisor restart was performed.

Diagnosis limit

The original event retained only React's wrapper, so its precise underlying exception cannot be reconstructed. This fixes the confirmed request-to-shutdown escalation and missing diagnostics rather than claiming a specific webhook payload was the trigger.

@coderabbitai

coderabbitai Bot commented Nov 11, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant