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

Prevent empty data from rendering move page modal. #553

Merged
merged 1 commit into from
Aug 5, 2019

Conversation

samiwel
Copy link
Contributor

@samiwel samiwel commented Aug 1, 2019

What is the context of this PR?

There seems to be an issue where sometimes, possibly when a value is both simultaneously being mutated and queried from the cache, where a Query component will return an empty data object, even though the query has finished loading and there are no errors.

This was causing our application to crash because the modal assumes that it is being passed a valid data object, based on assumptions being made in the PropTypes.

This is a known issue and this fix uses refetchPartial which according to the docs this is fine however we may have to keep an eye on this issue as it moves along apollographql/react-apollo/issues/2114

How to review

  1. Checkout master
  2. Add question page
  3. Observe crash and error
  4. Checkout this branch
  5. Add a question page
  6. Should no longer crash.

@samiwel samiwel force-pushed the bug-adding-question-page branch from e9126bc to 4edaac3 Compare August 1, 2019 13:11
@SamGodwin2 SamGodwin2 force-pushed the bug-adding-question-page branch from 4edaac3 to f79e8d5 Compare August 1, 2019 13:41
@samiwel
Copy link
Contributor Author

samiwel commented Aug 1, 2019

Error when adding page

@SamGodwin2 SamGodwin2 force-pushed the bug-adding-question-page branch from 18787da to f90156f Compare August 2, 2019 06:57
@SamGodwin2 SamGodwin2 force-pushed the bug-adding-question-page branch 6 times, most recently from 4c6de03 to bc0dacf Compare August 5, 2019 06:51
Copy link
Contributor

@pricea1 pricea1 left a comment

Choose a reason for hiding this comment

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

I'm getting occassional page not found errors.

  1. Create questionnaire
  2. Focus out of title input
  3. Click Add Page

Happens about 1 in 3 times.

@SamGodwin2 SamGodwin2 force-pushed the bug-adding-question-page branch 2 times, most recently from a3ad397 to 464bf92 Compare August 5, 2019 11:46
Copy link
Contributor

@pricea1 pricea1 left a comment

Choose a reason for hiding this comment

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

LGTM

@SamGodwin2 SamGodwin2 force-pushed the bug-adding-question-page branch 2 times, most recently from 051b144 to 4f0faf9 Compare August 5, 2019 12:52
@SamGodwin2 SamGodwin2 force-pushed the bug-adding-question-page branch from 4f0faf9 to 491b5b0 Compare August 5, 2019 12:57
@samiwel samiwel merged commit 57cdda9 into master Aug 5, 2019
@samiwel samiwel deleted the bug-adding-question-page branch August 5, 2019 13:50
@samiwel samiwel added this to the v0.30.0 milestone Aug 5, 2019
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.

3 participants