You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm getting the following error in production in unpredictable ways
Reply was already sent, did you forget to "return reply" in "<my url>" (POST)?
Here is the declaration of the fastify handler
fastify.post<ProxyMessageType>("/:project_id/subgraphs/:name/:version_label/gn*",{schema: ProxyMessageSchema,},async(req,reply)=>{constdeployment=awaitreq.deploymentCache.get({projectId: req.params.project_id,name: req.params.name,versionLabel: req.params.version_label,},async()=>req.goldskyDbClient,req.log);if(!deployment){req.log.warn("deployment not found");reply.status(404);reply.send({error: "reach out to support pls",});return;}constsubgraphUtils=getSubgraphUtils(deployment.project,req.opts);constsubgraphProxyUrl=subgraphUtils.getSubgraphHttpApiUrl(deployment.deploymentId).toString();constreplyFromUrl=`${subgraphProxyUrl}${req.params["*"]}`;requestCounter.inc({projectId: req.params.project_id,subgraphName: req.params.name,versionLabel: req.params.version_label,},1);constendTimer=requestGauge.startTimer({projectId: req.params.project_id,subgraphName: req.params.name,versionLabel: req.params.version_label,});returnreply.from(replyFromUrl,{onResponse: (_,reply,res)=>{res.on("end",()=>{endTimer();});reply.send(res);},});});
I see in the announcement doc that I should return reply if I call reply.send after the handler has finished. I suspect that's what I should do here but even when I switch to
Can you provide steps to reproduce? We often need a reproducible example, e.g. some code that allows someone else to recreate your problem by just copying and pasting it. If it involves more than a couple of different file, create a new repository on GitHub and add a link to that.
馃挰 Question here
I'm getting the following error in production in unpredictable ways
Here is the declaration of the fastify handler
I see in the announcement doc that I should
return reply
if I callreply.send
after the handler has finished. I suspect that's what I should do here but even when I switch toI still see the warning log line get printed.
Your Environment
The text was updated successfully, but these errors were encountered: