Skip to content

Development#19

Merged
ranuru merged 4 commits into
mainfrom
development
May 12, 2026
Merged

Development#19
ranuru merged 4 commits into
mainfrom
development

Conversation

@ranuru

@ranuru ranuru commented May 12, 2026

Copy link
Copy Markdown
Owner

This pull request refactors how timeouts are handled when running user code in Python challenges and introduces a utility function to centralize Python code execution logic. The changes improve maintainability and consistency for handling timeouts and errors.

Timeout and error handling improvements:

  • Introduced constants RUN_TIMEOUT_MS and RUN_TIMEOUT_MESSAGE for consistent timeout configuration and messaging across the file (frontend/src/pages/ChallengePage.jsx).
  • Updated the JavaScript worker timeout logic to use the new constants, improving maintainability (runWorker function in ChallengePage.jsx).

Python execution refactor:

  • Added a new runPython async function that wraps the /runner/run API call with timeout and error handling using AbortController, ensuring Python code execution is consistent with JavaScript execution (ChallengePage.jsx).
  • Refactored the main challenge runner to use the new runPython function, removing duplicated fetch and error handling logic from the component (ChallengePage.jsx).

Copilot AI and others added 4 commits May 12, 2026 13:45
Agent-Logs-Url: https://github.com/ranuru/schema-lab/sessions/0610e907-62a8-4f6e-af9d-51acd386714f

Co-authored-by: ranuru <126164337+ranuru@users.noreply.github.com>
Add client-side timeout and safe comparison for Python challenge runs
@ranuru ranuru self-assigned this May 12, 2026
@ranuru ranuru merged commit d8a5738 into main May 12, 2026
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.

2 participants