Open chungwong opened 3 months ago
The fact that setting the status happens after some async work makes this complicated. Fullstack now supports streaming which means there are a few different stages of the response:
Fullstack needs to choose chat response is sent to the client. Once the status is sent, it cannot be changed (mostly - we can send an incomplete streaming chunk to fail even after we send a 200 response)
Fullstack needs to insert any <head>
content that should be available for SEO. <head>
elements can be streamed in after this, but they may not be visible for SEO
Fullstack can only modify the head and body through javascript. Any text content should still be visible for SEO, but it may not be in the right order
I was talking with Jon about this, and we came up with this order:
1) Initially fullstack waits and accumulates contents without sending any response
2) Once the suspense boundary that contains the Router
renders, fullstack sets the status and renders the head
3) Each new suspense boundary is streamed in like normal
Problem
Discord reference Steps To Reproduce Given a route
and a component
Product
where it takes a url and fetch a product by THAT url. It is normal for that to failed due to unrecognised urls. In those case, it would be HTTP 404 NOT FOUND.The advised solution is to try
server_context
, however, that doesn't seem to work.Expected behavior The first request in the below screenshot should return 404(or whatever that was returned from the function. For the second AJAX call, that should behave the same?
Screenshots
Environment: