Fix: remove leading slash in finalizeRound endpoint to respect Axios baseURL#465
Open
ayushshukla1807 wants to merge 1 commit intohatnote:masterfrom
Open
Fix: remove leading slash in finalizeRound endpoint to respect Axios baseURL#465ayushshukla1807 wants to merge 1 commit intohatnote:masterfrom
ayushshukla1807 wants to merge 1 commit intohatnote:masterfrom
Conversation
|
Hi @ayushshukla1807, thanks for opening the PR. Could you please add a short description explaining the change and what behavior we should expect after it? This will make it much clearer for future contributors. |
Author
|
Thanks for the suggestion, @userAdityaa. To clarify context for future contributors: this patch addresses a regression where the redundant leading slash bypassed the global Axios |
|
Hey, I meant updating the PR description itself rather than adding the explanation only in the comments. |
Author
|
Done! The description has been updated with the technical context. |
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 #464.
Resolves a widespread network failure where Axios requests aimed at finalization endpoints silently dropped because a leading slash in
adminService.jsmanually overrode the global AxiosbaseURLinterceptor, rerouting the request to the domain root instead of/v1/admin/....Root Cause Analysis
The
adminService.jsendpoint strings were constructed with a leading/(e.g./admin/campaign/finalize). When Axios evaluates a URL that begins with/, it treats it as an absolute path and overrides the configuredbaseURLentirely. This means:baseURL:/v1/admin/campaign/finalize(strips/v1prefix)Technical Solution
Removed the leading
/from all affected endpoint strings inadminService.js. The Axios interceptor now correctly resolves paths relative to the/v1base prefix.Architectural Diagram
sequenceDiagram participant Vue as Vue Component participant Axios as Axios (baseURL: /v1) participant Backend as Flask (/v1/admin/...) Note over Vue,Backend: BEFORE fix (leading slash) Vue->>Axios: POST /admin/campaign/finalize Note over Axios: Leading / overrides baseURL Axios->>Backend: POST /admin/campaign/finalize Backend-->>Axios: 404 Not Found Note over Vue,Backend: AFTER fix (no leading slash) Vue->>Axios: POST admin/campaign/finalize Note over Axios: Relative path appended to baseURL Axios->>Backend: POST /v1/admin/campaign/finalize Backend-->>Axios: 200 OKImpact
This bug affected every coordinator attempting to finalize a round. The fix is a one-character change per endpoint with zero API surface impact and no breaking changes.