Skip to content

fix(site): ensure empty string error shows default message #10196

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

Merged
merged 5 commits into from
Oct 11, 2023

Conversation

Kira-Pilot
Copy link
Member

@Kira-Pilot Kira-Pilot commented Oct 10, 2023

resolves #9042

If we get a 404 or similar, Axios still creates a response body (with a missing message). We were not checking for this.

With this fix, we will still see an error banner because the API has stopped responding; however, now it is populated with our default message:
Screenshot 2023-10-11 at 12 07 47 PM

@github-actions
Copy link

github-actions bot commented Oct 11, 2023


✔️ PR 10196 Updated successfully.
🚀 Access the credentials here.

cc: @Kira-Pilot

@matifali
Copy link
Member

Testing this now.

@matifali
Copy link
Member

@Kira-Pilot issue is still there
image

@BrunoQuaresma
Copy link
Collaborator

@matifali can you please share the payload/response from the network errors? I'm guessing the BE maybe is sending an error message with an empty space. 🤔

@matifali
Copy link
Member

There is no backend. This happens when the coder is down. So network logs have either 503 or 403 errors.

return error.response.data.message;
}
if (typeof error === "string") {
// if error is a non-empty string
if (error && typeof error === "string") {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

even though this wasn't the fix for this bug, I'm keeping it because we should guard against empty strings anyway

@Kira-Pilot
Copy link
Member Author

@BrunoQuaresma @matifali pushed another fix that has been tested thanks to Atif's PR deployment. Can you take another look when you get a chance?

@matifali
Copy link
Member

We have verified that it is resolved. Thanks @Kira-Pilot

@Kira-Pilot
Copy link
Member Author

We have verified that it is resolved.
Thanks so much for your help @matifali!

@Kira-Pilot Kira-Pilot merged commit 7c66878 into main Oct 11, 2023
@Kira-Pilot Kira-Pilot deleted the getErrorMessage-empty-string/kira-pilot branch October 11, 2023 17:54
@github-actions github-actions bot locked and limited conversation to collaborators Oct 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: When Coder is upgraded workspace page shows an empty banner
3 participants