processing / processing/p5.js-web-editor
signup form gets stuck when signup request fails due to network error
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.7k
- Forks
- 1.7k
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 8
Description
p5.js version
2.3.2
What is your operating system?
Linux
Web browser and version
firefox 153.0.1
Actual Behavior
If the signup request fails because of a network error, the signup form gets stuck in the submitting state indefinitely.
the error handler in validateAndSignUpUser() assumes that error.response always exists and tries to access response.data.error. for network errors, axios doesn't provide a response object, so this throws a TypeError before the promise can resolve.
i get:
TypeError: Cannot read properties of undefined (reading 'data')
the form stays stuck in the submitting state instead of showing an error or finishing the submission.
Expected Behavior
If the signup request fails because of a network error, the error should be handled gracefully and the signup form should stop submitting and show an appropriate error message.
Steps to reproduce
- open the p5.js web editor and go to the signup page
- enter valid signup details
- make the POST /signup request fail with a network error, for example by disconnecting the network or blocking the request
- submit the form
- notice that the form stays in the submitting state and no useful error is shown
Snippet:
.catch((error) => {
const { response } = error;
dispatch(authError(response.data.error));
resolve({ error });
});
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating validateAndSignUpUser() and inspect the signup form's error and submitting-state handling around the shown catch block. Reproduce a failed POST /signup request by blocking the network, then verify that failures without an Axios response are handled gracefully, the form leaves the submitting state, and an appropriate error is shown.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- authentication, frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 78/100