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

fix race condition dependent bug of loading feature toggles #3167

Merged
merged 3 commits into from
Sep 6, 2018

Conversation

philippotto
Copy link
Member

@philippotto philippotto commented Sep 6, 2018

URL of deployed dev instance (used for testing):

  • https://___.webknossos.xyz

Steps to test:

(I tested it quite thoroughly, but for the record...)

  • if you want to make the bug reproducible, you can run yarn disable-autologin and change the getFeatureToggles function in admin_rest_api.js to
export async function getFeatureToggles(): Promise<APIFeatureToggles> {
  await Utils.sleep(5000);
  return Request.receiveJSON("/api/features");
}
  • then, make sure you are not logged in and visit the dashboard
  • using the code of this PR, the bug shouldn't occur anymore

Issues:


@philippotto philippotto self-assigned this Sep 6, 2018
Copy link
Member

@daniel-wer daniel-wer left a comment

Choose a reason for hiding this comment

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

LGTM, nice find! Was this causing the error when logging out sometimes?

@philippotto philippotto merged commit c18124b into master Sep 6, 2018
@philippotto
Copy link
Member Author

Was this causing the error when logging out sometimes?

Yes, I assume so :)

@philippotto philippotto deleted the fix-features-race-condition branch January 24, 2019 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Race condition when loading api/features on app initialization
2 participants