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: onCompleted not updating regression #9226

Merged
merged 3 commits into from
Jan 10, 2022

Conversation

mmahalwy
Copy link
Contributor

@mmahalwy mmahalwy commented Dec 21, 2021

Fixes regression caused by:
f1a9770#diff-fb7fa652de6d84c08b87344a06a4d120b664c6e8bf491d16575794c755141477R136-R142

I tested this on 3.4.0 and it works as expected. This broke on 3.5.x. I think it's also related to this issue but for queries.

I also wrote the tests and confirmed that tests were failing prior to my change.

Checklist:

  • If this PR is a new feature, please reference an issue where a consensus about the design was reached (not necessary for small changes)
  • Make sure all of the significant new logic is covered by tests

@mmahalwy
Copy link
Contributor Author

cc @brainkim as your change caused the regression

@valentinbourqui
Copy link

valentinbourqui commented Jan 7, 2022

We detected the same regression and without this fix we are not able to update to update Apollo and to update GraphQL with version 16. All forms are not working anymore. And I'm a little bit afraid to wait long time when I see all pull requests open. This fix must be treated with a higher priority.

@mmahalwy
Copy link
Contributor Author

mmahalwy commented Jan 8, 2022

Tbh it's super disappointing this has been open for a while and no attention..

Copy link
Member

@benjamn benjamn left a comment

Choose a reason for hiding this comment

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

Thanks for diagnosing/fixing/testing this, and sorry for the wait @mmahalwy!

@benjamn benjamn added this to the v3.5.x patch releases milestone Jan 10, 2022
@brainkim
Copy link
Contributor

@mmahalwy Thanks for this!

@benjamn benjamn force-pushed the me--fix-regresion-on-complete branch from 7ba6b6b to c1deb4f Compare January 10, 2022 17:02
@benjamn benjamn merged commit 02f2e4f into apollographql:main Jan 10, 2022
@mmahalwy
Copy link
Contributor Author

Np! Thanks @brainkim and @benjamn for making this great library!

@dankolesnikov
Copy link

@mmahalwy oh my, great find - THANK YOU!

@nathanredblur
Copy link

Thank you for this fix.

I think this error was also affecting useLazyQuery
I had 3.5.5 and when I had this.

const onCompleted = () => console.log("Success")

const [fetchCategory, data, error }] =
    useLazyQuery(PAYMENT_METHOD_FORM_CATEGORY_QUERY, {
      fetchPolicy: 'cache-first',
      onCompleted: onCompleted,
    });

on call fetchCategory the first time, I get the console.log
but on call the second time, I did'n had the log.

on move on to the version 3.5.8, this error it's gone.
but maybe a test will be good to ensure this error not happen again.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 15, 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.

None yet

6 participants