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

[Bug]: Cell stays in Loading State if Apollo client throws an error #11893

Open
1 task done
Philzen opened this issue Jan 10, 2025 · 1 comment
Open
1 task done

[Bug]: Cell stays in Loading State if Apollo client throws an error #11893

Philzen opened this issue Jan 10, 2025 · 1 comment
Labels
bug/needs-info More information is needed for reproduction

Comments

@Philzen
Copy link
Contributor

Philzen commented Jan 10, 2025

What's not working?

I recently cleaned up some code in our project and removed all fields from a Cell query that weren't actually consumed anywhere in the code. Sometime later i discovered the Cell to stay in ` state indefinitely, although on the network tab i could see all graphql queries came back fine.

After some more investigation it turned out the underlying issue was Uncaught Invariant Violation: Missing field '…' while extracting keyFields from { … } being thrown by apollo (which after a little digesting made sense to me), leading to the cell somehow never reaching the success state – or in this case: the correct behavior would have been to render the <Error /> component.

How do we reproduce the bug?

My issue was triggered by leaving out the apollo keyField responsible for network caching… however i believe there may be other errors that simply are not caught properly in the cell component.

What's your environment? (If it applies)

System:
    OS: Linux 6.12 Manjaro Linux
    Shell: 5.2.37 - /bin/bash
  Binaries:
    Node: 20.16.0 - /tmp/xfs-ed1dba40/node
    Yarn: 4.4.0 - /tmp/xfs-ed1dba40/yarn
  Databases:
    SQLite: 3.47.2 - /usr/bin/sqlite3
  npmPackages:
    @redwoodjs/auth-dbauth-setup: 8.4.2 => 8.4.2 
    @redwoodjs/cli-storybook-vite: 8.4.2 => 8.4.2 
    @redwoodjs/core: 8.4.2 => 8.4.2 
    @redwoodjs/project-config: 8.4.2 => 8.4.2

Are you interested in working on this?

  • I'm interested in working on this
@Philzen Philzen added the bug/needs-info More information is needed for reproduction label Jan 10, 2025
@Philzen
Copy link
Contributor Author

Philzen commented Jan 10, 2025

Not sure, but may be worth checking first if this isn't the result of a race condition due to re-instantiated apollo clients as described in #11602, so first check out @justinadkins' fix branch from #11699 and see if this issue persists with that fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/needs-info More information is needed for reproduction
Projects
None yet
Development

No branches or pull requests

1 participant