From 1ba06083ceabdbdc01be3dfa1dfc2fa02652b237 Mon Sep 17 00:00:00 2001 From: Takis Kakalis <80459599+Takaros999@users.noreply.github.com> Date: Tue, 24 Feb 2026 18:07:14 -0800 Subject: [PATCH 1/2] Fallback to precheck if proof-context fails --- src/services/metadata.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/services/metadata.ts b/src/services/metadata.ts index 0389504..d2b02ae 100644 --- a/src/services/metadata.ts +++ b/src/services/metadata.ts @@ -130,11 +130,16 @@ export async function fetchMetadata( }, }; - // IDKit v4: use /proof-context when environment is provided - // Legacy: fall back to /precheck - const response = request.environment - ? await proofContextAction(request) - : await precheckAction(request); + // Attempt to call /proof-context to get app/action context + // This could fail: + // 1. If RPs haven't migrated in the Dev Portal + // 2. If the app is a legacy `app_staging_...` + // Fallback to legacy precheck action + // TODO: Clean this up once we add World ID 4.0 to the simulator + let response = await proofContextAction(request); + if (response === null) { + response = await precheckAction(request); + } if (response) { metadata = { From 5af7859d71282d96cb46e4551c85fe75200b2373 Mon Sep 17 00:00:00 2001 From: Takis Kakalis <80459599+Takaros999@users.noreply.github.com> Date: Tue, 24 Feb 2026 18:13:45 -0800 Subject: [PATCH 2/2] revert --- src/services/metadata.ts | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/services/metadata.ts b/src/services/metadata.ts index d2b02ae..0389504 100644 --- a/src/services/metadata.ts +++ b/src/services/metadata.ts @@ -130,16 +130,11 @@ export async function fetchMetadata( }, }; - // Attempt to call /proof-context to get app/action context - // This could fail: - // 1. If RPs haven't migrated in the Dev Portal - // 2. If the app is a legacy `app_staging_...` - // Fallback to legacy precheck action - // TODO: Clean this up once we add World ID 4.0 to the simulator - let response = await proofContextAction(request); - if (response === null) { - response = await precheckAction(request); - } + // IDKit v4: use /proof-context when environment is provided + // Legacy: fall back to /precheck + const response = request.environment + ? await proofContextAction(request) + : await precheckAction(request); if (response) { metadata = {