Skip to content

feat: raise descriptive error when proctoring provider cannot remove an attempt - #1337

Open
Anas12091101 wants to merge 4 commits into
openedx:masterfrom
mitodl:anas/proctoring-reset-descriptive-error
Open

feat: raise descriptive error when proctoring provider cannot remove an attempt#1337
Anas12091101 wants to merge 4 commits into
openedx:masterfrom
mitodl:anas/proctoring-reset-descriptive-error

Conversation

@Anas12091101

@Anas12091101 Anas12091101 commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Description:

Makes proctored-exam attempt removal fail loudly and clearly when the proctoring provider errors, instead of hanging, returning an unhandled 500 (which rolled back the local delete), or silently doing a local-only reset.

  • Timeout on the REST backend request so a slow/unavailable provider can't hang the request. Default 30s, overridable per backend via timeout in PROCTORING_BACKENDS.
  • On failure, the pre_delete handler logs it and raises a typed BackendProviderCannotRemoveAttempt (HTTP 502) instead of a 500; the local delete is aborted so the attempt is preserved.
    • Unreachable / timeout → generic "temporarily unavailable, try again" message.
    • Provider HTTP error (4xx/5xx) → previously only logged while still deleting locally; now raises a provider-status-aware 502 and logs the raw provider response. On by default, disable per backend via raise_on_remove_error in PROCTORING_BACKENDS.
  • Benign cases (e.g. attempt with no external_id) are unchanged — reset still proceeds.

Tests cover the timeout (default + configurable), the unreachable and provider-error paths (with/without body, and the opt-out), and preserving the provider message vs. the generic one.

Pre-Merge Checklist:

  • Updated the version number in edx_proctoring/__init__.py and package.json if these changes are to be released.
  • Described your changes in CHANGELOG.rst
  • Confirmed Github reports all automated tests/checks are passing.
  • Approved by at least one additional reviewer.

Post-Merge:

  • Create a tag matching the new version number.

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Jul 24, 2026
@openedx-webhooks

Copy link
Copy Markdown

Thanks for the pull request, @Anas12091101!

This repository is currently maintained by @openedx/openedx-unmaintained.

Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

Details
Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@mphilbrick211 mphilbrick211 moved this from Needs Triage to Ready for Review in Contributions Jul 27, 2026
@mphilbrick211 mphilbrick211 added the needs reviewer assigned PR needs to be (re-)assigned a new reviewer label Jul 27, 2026
@mphilbrick211
mphilbrick211 requested a review from feanil July 27, 2026 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs reviewer assigned PR needs to be (re-)assigned a new reviewer open-source-contribution PR author is not from Axim or 2U

Projects

Status: Ready for Review

Development

Successfully merging this pull request may close these issues.

3 participants