LegendList + Relay integration bug repro#350
LegendList + Relay integration bug repro#350MarceloPrado wants to merge 6 commits intoLegendApp:mainfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| import type { | ||
| LegendListRelayWarningTest_ConversationQuery, | ||
| LegendListRelayWarningTest_ConversationQuery$data, | ||
| } from "./__generated__/LegendListRelayWarningTest_ConversationQuery.graphql"; | ||
| import type { | ||
| LegendListRelayWarningTest_messageRowFragment$data, | ||
| LegendListRelayWarningTest_messageRowFragment$key, | ||
| } from "./__generated__/LegendListRelayWarningTest_messageRowFragment.graphql"; | ||
| import type { LegendListRelayWarningTest_PostMessageMutation } from "./__generated__/LegendListRelayWarningTest_PostMessageMutation.graphql"; |
There was a problem hiding this comment.
Integration tests depend on missing Relay artifacts
The new integration suite imports generated files from jest-tests/integration/__generated__, but those files are ignored from source control and the test:integration script only invokes Jest. Running the script on a fresh clone (after bun install) will immediately throw Cannot find module './__generated__/LegendListRelayWarningTest_*' because no step generates the Relay artifacts. To make the command reliable for CI and other developers, the script should run relay-compiler (or commit the generated files) before starting Jest; otherwise the added tests cannot execute.
Useful? React with 👍 / 👎.
Context
There is some gnarly issue happening between LegendList row caching and Relay. More context here and a reproduction here.
This PR adds two integration tests, one with LegendList and another with a mocked FlatList.
The LegendList fails the test, since it's throwing the console.error reported above. My goal is this may help the team investigate the issue. I don't expect this code to land - it's very specific to relay usecase, but feel free to take it over/modify as you please.
How to repro
bun installto install all dependencies required for the testbun relay-compilerto generate the GraphQL codegen artifactsbun test:integrationto run the tests.It should succeed for both FlatList and LegendList. Currently failing on LegendList.