Fix: Prevent 500 POST errors via strict frontend schema validation during Round Creation#454
Open
ayushshukla1807 wants to merge 1 commit intohatnote:masterfrom
Open
Conversation
This was referenced Apr 1, 2026
Closed
Closed
Open
087b5f8 to
0a78447
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #447.
Resolves Server 500 errors occurring when organizers attempted to submit
NewCampaignorNewRoundforms missing heavily required parameters that the DAO refused.Technical Solution
I implemented a strict client-side validation schema inside the
CampaignandRoundform components. By asserting required parameter rules natively in the Vue bindings before the final Axios dispatch, we successfully prevent malformed UI packets from triggering catastrophic backend stack traces.The guards are enforced in the following order:
deadline_dateis nullArchitectural Diagram
sequenceDiagram participant User participant Form as Vue Template (RoundNew.vue) participant Guard as submitRound() Guard participant Axios as adminService User->>Form: Clicks Add Round (empty fields) Form->>Guard: Invokes submitRound() Guard-->>Form: Deadline missing? alertService.error() Guard-->>Form: Name empty? alertService.error() Guard-->>Form: Quorum invalid? alertService.error() Guard-->>Form: Category missing? alertService.error() Note over Guard: All guards pass Guard->>Axios: adminService.addRound(payload) Axios-->>Form: 200 OKVerification (Local Dev)
Tested locally on
http://localhost:5173against a live Flask backend on port 5005.