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

Bug/infinite loading #5643

Merged
merged 9 commits into from
Mar 29, 2021
Merged

Bug/infinite loading #5643

merged 9 commits into from
Mar 29, 2021

Conversation

Baroshem
Copy link
Collaborator

Related Issues

closes #5508
closes #5463

Short Description of the PR

Fixed problem with infinite loading caused by not having error handing in core/middleware. By implementing try catch, and throwing more accurate error in useUserFactory, now LoginModal is not closing after incorrect register/login attempt and it shows appropriate error. It also allowed to fix another problem related to empty shipping method when there was no shipping methods available.

Screenshots of Visual Changes before/after (if There Are Any)

image

image

Pull Request Checklist

  • I have updated the Changelog (V1) v2 and mentioned all breaking changes in the public API.
  • I have documented all new public APIs and made changes to existing docs mentioning the parts I've changed so they're up to date.
  • I have tested my Pull Request on production build and (to my knowledge) it works without any issues

@Baroshem Baroshem changed the title Bug/infinite loading [WIP] Bug/infinite loading Mar 10, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Mar 10, 2021

💙 vsf-next-demo successfully deployed at https://bbfdaa6a314d153caac78a67b40a7a65950bf07d.vsf-next-demo.preview.storefrontcloud.io

@coveralls
Copy link

coveralls commented Mar 10, 2021

Pull Request Test Coverage Report for Build 675572243

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 5 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.03%) to 80.091%

Files with Coverage Reduction New Missed Lines %
packages/core/middleware/src/createServer.ts 5 0.0%
Totals Coverage Status
Change from base Build 667588630: -0.03%
Covered Lines: 1507
Relevant Lines: 1753

💛 - Coveralls

@Baroshem Baroshem changed the title [WIP] Bug/infinite loading Bug/infinite loading Mar 10, 2021
@Baroshem Baroshem changed the title Bug/infinite loading [WIP] Bug/infinite loading Mar 11, 2021
@Baroshem Baroshem changed the title [WIP] Bug/infinite loading Bug/infinite loading Mar 11, 2021
@@ -63,7 +64,7 @@ export const useUserFactory = <USER, UPDATE_USER_PARAMS, REGISTER_USER_PARAMS ex
user.value = await _factoryParams.register(providedUser);
error.value.register = null;
} catch (err) {
error.value.register = err;
error.value.register = err.response?.data || err;
Copy link
Contributor

Choose a reason for hiding this comment

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

just err - you can't assume graphql in the core

if (hasUserErrors) {
error.login = userError.value.login;
error.register = userError.value.register;
const loginGraphQLErrorMessage = loginGraphQLError?.graphQLErrors[0]?.message;
Copy link
Contributor

Choose a reason for hiding this comment

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

same here - this is core template

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Moved error handling CT integration

@Baroshem Baroshem merged commit 3f61ee2 into next Mar 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants