Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Report Stuck in Submitted State and Update Code Logic #4272

Open
sambodeme opened this issue Sep 11, 2024 · 0 comments
Open

Fix Report Stuck in Submitted State and Update Code Logic #4272

sambodeme opened this issue Sep 11, 2024 · 0 comments
Labels

Comments

@sambodeme
Copy link
Contributor

sambodeme commented Sep 11, 2024

GitHub Ticket: Fix Report Stuck in Submitted State and Update Code Logic

Context:
This issue is related to helpdesk ticket #4652. A user reported that their report is stuck in the "submitted" state and does not display the "accepted" badge.

For reference, after a successful submission, a report should transition from auditee_certified to submitted while the dissemination process is ongoing. Once the dissemination completes successfully, the report should then transition from submitted to disseminated. However, in the case associated with ticket #4652, the final transition from submitted to disseminated never occurred.

Issue:
Upon investigation, it was unclear whether this issue was caused by human error (the user possibly clicked "submit" multiple times while the first submission was still processing) or a system issue (potential race conditions during the state transition and associated database operations).

Regardless of the root cause, it is evident that the dissemination part of the process did not execute as expected. This led the submission process into the else block of an if statement, where there was no logic to handle this specific scenario, resulting in the report being stuck in the "submitted" state.

Proposed Fixes:

  1. Update the Code:

    • Modify the else block to properly handle the case where dissemination fails, ensuring that the process can continue without getting stuck. Add proper logic and error handling (beyond just pass), including logging for better traceability.
  2. Add a Django Command or Admin Process:

    • Provide a Django command or admin process to allow administrators to transition reports that are stuck in the "submitted" state.
    • The process should follow sac waiver approach and:
      1. Perform full validation of the report.
      2. If validation is successful, trigger the dissemination and transition the report from submitted to disseminated.
      3. If validation fails, transition the report back to auditee_certified so the user can address any issues and resubmit.

This fix will prevent future reports from being trapped in this state and ensure smooth transitions between report states.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Triage
Development

No branches or pull requests

1 participant