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

Infinite loop when unable to load project #128

Closed
jeremydw opened this issue Jul 22, 2021 · 1 comment · Fixed by #214
Closed

Infinite loop when unable to load project #128

jeremydw opened this issue Jul 22, 2021 · 1 comment · Fixed by #214
Assignees
Labels
bug Something isn't working
Milestone

Comments

@jeremydw
Copy link
Member

Steps to reproduce:

  1. Run npx @blinkk/editor.dev in a folder that just has a views/partials directory
  2. Ensure the directory has no commits in it (but is a valid git repo)

Observe attached screenshot

image

@adelaidemt adelaidemt added the bug Something isn't working label Aug 3, 2021
@adelaidemt adelaidemt added this to the Live Version milestone Aug 4, 2021
@Zoramite Zoramite changed the title Stuck in infinite loop of errors on fresh local project Infinite loop when unable to load project Aug 4, 2021
@Zoramite
Copy link
Member

Zoramite commented Aug 4, 2021

When there is no project information, many parts of the editor try to load the project config. But when there is an error getting the project information the editor keeps trying to load the project which causes an infinite loop of requests to load the project.

Zoramite added a commit that referenced this issue Aug 6, 2021
When data is being retrieved from the api it handles the error and displays a notification, but the next render tries to reload the same api call since the value is still undefined.

This change gives a null value for data in the state for the values that are loaded without arguments and adds helper functions that trigger the api calls if the value is undefined but not if it is null. This makes it simpler for the UI to use the state without having to know and handle the null state and still allow for lazy loading of the data.

fixes #128
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants