{"record":{"id":"ab52a9445c167cdd","repo":"diegosouzapw/OmniRoute","slug":"ineligible-free-provider-ids-invalidids-join","errorCode":null,"errorMessage":"Ineligible free provider IDs: ${invalidIds.join(\", \")}","messagePattern":"Ineligible free provider IDs: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/lib/providers/freeOnboarding.ts","lineNumber":110,"sourceCode":"}\n\ninterface SetupFreeProviderConnectionsOptions {\n  requestedIds: string[];\n  candidates: FreeOnboardingProvider[];\n  listExisting: () => Promise<ExistingProviderConnection[]>;\n  create: (input: FreeProviderConnectionInput) => Promise<{ id?: unknown } | null>;\n}\n\nfunction validateRequestedIds(\n  requestedIds: string[],\n  candidates: FreeOnboardingProvider[]\n): Map<string, FreeOnboardingProvider> {\n  const candidatesById = new Map(candidates.map((candidate) => [candidate.id, candidate]));\n  const invalidIds = [...new Set(requestedIds)]\n    .filter((providerId) => !candidatesById.has(providerId))\n    .sort((left, right) => left.localeCompare(right));\n  if (invalidIds.length > 0) {\n    throw new Error(`Ineligible free provider IDs: ${invalidIds.join(\", \")}`);\n  }\n  return candidatesById;\n}\n\nexport async function setupFreeProviderConnections(\n  options: SetupFreeProviderConnectionsOptions\n): Promise<{ results: FreeProviderSetupResult[] }> {\n  const candidatesById = validateRequestedIds(options.requestedIds, options.candidates);\n  const results: FreeProviderSetupResult[] = [];\n\n  for (const providerId of [...new Set(options.requestedIds)]) {\n    const existing = await options.listExisting();\n    if (existing.some((connection) => connection.provider === providerId)) {\n      results.push({ providerId, status: \"skipped\", reason: \"already-configured\" });\n      continue;\n    }\n\n    const candidate = candidatesById.get(providerId)!;","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/providers/freeOnboarding.ts#L92-L128","documentation":"validateRequestedIds in freeOnboarding deduplicates requestedIds and throws when any id is not present in the eligible candidates map — i.e. setup was asked to onboard provider ids that are not free-onboarding providers.","triggerScenarios":"Thrown at src/lib/providers/freeOnboarding.ts:110 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove the listed ids from the requestedIds input","Pick ids from the free-onboarding candidate list exposed by the setup flow","Fix typos in provider ids passed to free-provider setup"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}