npx wrangler dev --remote, where your Workers are run in Cloudflare and that will allow you to connect to your remote databasemapFound: true on occasion. Logging in pages functions is very limited, but we we were able to reproduce the bug by barraging the API with requests until it falsely returns mapFound: true.maps table doesn't change often - a few modifications a day at best. Seems like a hyperdrive bug to me, but I don't have any evidence to support it except for the info provided above.map.geoguessrId !== params.geoguessrId as a bandaid fix in a desperate attempt to fix it and it seems to be doing the trick. No idea what map object is being returned, logging would really help PostgresError: Internal error from Hyperdrive.
npx wrangler dev --remoteConnection lost: The server closed the connection.const map = await db.query.maps.findFirst({
where: eq(maps.geoguessrId, params.geoguessrId)
});
if (!map) {
return json({ mapFound: false }, { status: 404 });
}
return json({
mapFound: true
});mapFound: truemapFound: truemapsmap.geoguessrId !== params.geoguessrIdPostgresError: Internal error