Skip to content

Conversation

sameelarif
Copy link
Member

No description provided.

Copy link

vercel bot commented Oct 6, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
priv-gemini-browser Ready Ready Preview Comment Oct 7, 2025 0:03am


console.log("timezone ", timezone);
console.log("getClosestRegion(timezone)", getClosestRegion(timezone));
const config = await getAll<EdgeConfig>();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const config = await getAll<EdgeConfig>();
let config: EdgeConfig;
try {
config = await getAll<EdgeConfig>();
} catch (error) {
console.warn('Edge Config unavailable, using defaults:', error);
config = { advancedStealth: undefined, proxies: undefined };
}

The getAll<EdgeConfig>() call may throw an error when the Edge Config is not set up or accessible, but this error is not caught and will cause the entire session creation to fail.

View Details

Analysis

Unhandled Edge Config error breaks session creation API

What fails: createSession() in app/api/session/route.ts calls getAll<EdgeConfig>() without error handling, causing 500 errors when Edge Config is not configured

How to reproduce:

# Without EDGE_CONFIG environment variable set:
curl -X POST http://localhost:3000/api/session -H "Content-Type: application/json" -d '{"timezone":"PST"}'

Result: Returns 500 Internal Server Error with message "@vercel/edge-config: No connection string provided"

Expected: Should return 200 OK with session data, using default values (advancedStealth: false, proxies: true) when Edge Config is unavailable per Vercel Edge Config SDK docs

@sameelarif sameelarif merged commit 33a83eb into sameel/flags-new Oct 7, 2025
2 of 3 checks passed
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

Successfully merging this pull request may close these issues.

1 participant