-
Notifications
You must be signed in to change notification settings - Fork 572
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: use the same relay env between Home screen and useMutation
#8636
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oof 😅 thanks Dima! Will create a ticket for this on MOPLAT to address all of these issues in all the places that we have the default environment!
cc @damassi
@gkartalis thank you 🙏 |
src/app/Scenes/Home/Home.tests.tsx
Outdated
let mockEnvironment: ReturnType<typeof createMockEnvironment> | ||
|
||
beforeEach(() => { | ||
mockEnvironment = createMockEnvironment() | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we could also use 'getRelayMockEnvironment' theoretically, no need to refactor though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm doing it right now. I noticed getRelayMockEnvironment
at the last moment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will work if we manually pass mocked env to the Home query renderer component: 1ee7eb8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for the fix @dimatretyak 🌟
ac0bab7
to
adbde24
Compare
This PR resolves CX-3586
Related PR: #8442
Description
The problem in the CX-3586 task was that we used different relay env on the Home screen and
useMutation
(this hook uses env, which is passed here).We have already faced such a problem here and here + some related PR from George
Demo
Artists
Artists.mp4
artists.mp4
Artworks
Artworks.mp4
artworks.mp4
PR Checklist
To the reviewers 👀
Changelog updates
Changelog updates
Cross-platform user-facing changes
iOS user-facing changes
Android user-facing changes
Dev changes
useMutation
- dimatretyakNeed help with something? Have a look at our docs, or get in touch with us.