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: apply updated schema on refresh #81

Merged
merged 3 commits into from
Mar 21, 2024

Conversation

luke88jones
Copy link
Contributor

fixes #80

  • update the gateway refresh function to call replaceSchema on the GQL instance

@simoneb simoneb requested a review from codeflyer July 20, 2023 14:55
lib/gateway/build-gateway.js Show resolved Hide resolved
test/schemaRefresh.js Outdated Show resolved Hide resolved
Comment on lines 129 to 131
for (let i = 0; i < 10; i++) {
await t.context.clock.tickAsync(200)
}
Copy link

Choose a reason for hiding this comment

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

why are you ticking the clock in a loop?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As mentioned this was from following the polling tests. I've now removed these.

test/schemaRefresh.js Outdated Show resolved Hide resolved
test/schemaRefresh.js Show resolved Hide resolved
Copy link

@simoneb simoneb left a comment

Choose a reason for hiding this comment

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

LGTM but I'd like to wait for another review from @codeflyer

Copy link
Contributor

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@simoneb
Copy link

simoneb commented Jul 21, 2023

@luke88jones I'm seeing a consistent failure on Node 18 due to a timeout. Because this hasn't happened in the past and because the new behavior you introduced may have interactions with the event loop, I'm tempted to think that this is a legitimate failure, although I'm not sure why it would happen just on Node 18

@luke88jones
Copy link
Contributor Author

@simoneb Sorry for the silence on this I've been on paternity leave.

It looks like one of the polling interval tests is timing out. I'll see what I can find.

@simoneb
Copy link

simoneb commented Aug 14, 2023

Thanks @luke88jones and no worries! If you could take a quick look since you were the author of this change, I would appreciate it. Shout if you find out something or if you think this requires too much work, in which case we can consider proceeding in a different way

@luke88jones
Copy link
Contributor Author

@simoneb I've just checked out the main branch locally I have the same failure. I'm trying to track down the issue but it looks to be something to do with closing the userService in this test in the tests/pollingInterval.js file
"Polling schemas (if service is down, schema shouldn't be changed)"

@simoneb
Copy link

simoneb commented Aug 14, 2023

Good catch, thanks. Interesting that it only happens (seemingly) in Node 18. If that's the case it would be interesting to figure out why.

@mcollina mcollina merged commit 21e897d into mercurius-js:main Mar 21, 2024
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.

Schema not updated when calling refresh
4 participants