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

Checking invalid post crashes server #232

Open
xHomu opened this issue Jan 9, 2024 · 0 comments
Open

Checking invalid post crashes server #232

xHomu opened this issue Jan 9, 2024 · 0 comments

Comments

@xHomu
Copy link
Contributor

xHomu commented Jan 9, 2024

The way the post fetches work atm would crash the server due to graphql type errors:

https://github.com/manawiki/core/blob/main/app/routes/_site+/p+/utils/fetchPostWithSlug.server.ts

  • invariant(post, "Post doesn't exist");

https://github.com/manawiki/core/blob/main/app/routes/_site+/p+/utils/fetchPostComments.server.ts

  • postParentId: "JSON!", this triggers graphql type error

Because these graphql queries are dependent each other, one's invalid would trigger a server crash onto the other. We should rework these queries a bit safer so it would just render a Post not found.

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

No branches or pull requests

1 participant