diegosouzapw/OmniRoute · error · Error

Provider connection changed while browser login was active

Error message

Provider connection changed while browser login was active

What it means

Post-harvest consistency check in harvestSession: the connection still exists but its provider field no longer equals session.providerId. Means the connection was edited/switched to a different provider while the browser-login session was open, so the harvested credential recipe (built for the original provider) would be written into the wrong provider's fields.

Solutions

  1. Stop the stale session and start browser login again for the connection's new provider
  2. Block provider changes on connections with active browser-login sessions
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/lib/vncSession/service.ts:295 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25). Data as JSON: /api/errors/c81830437d72c0e3. Report an issue: GitHub.

Appendix: source

Thrown at src/lib/vncSession/service.ts:295

      provider,
      VNC_CONFIG.harvestTimeoutMs
    );
    session.lastHarvestAt = Date.now();
    if (!harvest.hasCredential) {
      return {
        harvested: false,
        sessionId,
        connectionId,
        providerId: session.providerId,
        updatedFields: [],
        validation: null,
      };
    }

    const connection = await getProviderConnectionById(connectionId);
    if (!connection) throw new Error("Provider connection no longer exists");
    if (connection.provider !== session.providerId) {
      throw new Error("Provider connection changed while browser login was active");
    }

    const { providerSpecificData, apiKey } = harvestToCredentials(harvest, provider);
    const existingData =
      connection.providerSpecificData &&
      typeof connection.providerSpecificData === "object" &&
      !Array.isArray(connection.providerSpecificData)
        ? connection.providerSpecificData
        : {};
    const mergedData = { ...existingData, ...providerSpecificData };

    await updateProviderConnection(connectionId, {
      providerSpecificData: mergedData,
      ...(apiKey ? { apiKey } : {}),
    });

    const validationKey =
      apiKey ||

View on GitHub (pinned to a179ffed5b)