Skip to content

fix(db): keep both web-cookie accounts when a typed connection name is reused (#15070) - #15844

Merged
diegosouzapw merged 2 commits into
release/v3.8.52from
fix/15070-typed-connection-name-overwrit
Oct 8, 2026
Merged

diegosouzapw merged 2 commits into
release/v3.8.52from
fix/15070-typed-connection-name-overwrit

Conversation

@diegosouzapw

Copy link
Copy Markdown
Collaborator

Closes #15070

Owner decision (2026-10-06): keep both accounts, no 409 — aligned with the cookie path fixed in #15290 (#15159 B-01).

Root cause

The dashboard single-add modal posts authType: apikey for web-cookie providers. createProviderConnection's apikey branch did a name-based upsert first, so a second account typed under an already-used name replaced the first account's stored session.

Fix

Skip the apikey name-upsert for providers in WEB_COOKIE_PROVIDERS (new isWebCookieProviderId in src/lib/db/webSessionDedup.ts). The credential-value dedup (#3023) still collapses the same session re-added; ordinary apikey providers keep the name upsert (#2587/#3023).

Regression test

tests/unit/db-provider-apikey-name-overwrite-15070.test.ts (3 cases: web-cookie same name + different session keeps both; same session re-added dedups; ordinary provider keeps upsert).

  • RED on base logic: same name + different session keeps both accounts fails (only B_SESSION remained).
  • GREEN with fix: 3/3 pass.
    Existing suites re-run green: db-provider-cookie-dedup-3368, db-provider-cookie-name-collision-15159, db-providers-crud, provider-connection-apikey-dedup, provider-connection-local-baseurl-dedup, web-session-dedup-3368.

Gates

typecheck:core, eslint (changed files), check-file-size (providers.ts held at its 1240 ceiling), prettier. complexity/cognitive violation counts for providers.ts unchanged vs base (measured per-file with the ratchet ESLint config; the full-repo scripts did not finish on the loaded devbox).

⚠️ base-red inherited: #15306 — unit/integration suite timeouts, vitest audit.test.ts, package-artifact, tarball boot-smoke, ai-attribution range (not caused by this PR)

diegosouzapw and others added 2 commits October 8, 2026 02:15
…s reused (#15070)

The apikey name-based upsert replaced account A's session with account B's whenever two web-cookie provider accounts shared a connection name. Skip the name upsert for WEB_COOKIE_PROVIDERS; the credential-value dedup still collapses the same session re-added.
@diegosouzapw
diegosouzapw merged commit 79c9348 into release/v3.8.52 Oct 8, 2026
24 of 46 checks passed
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

CI Coverage Report

  • Coverage job: skipped
  • PR test policy: success

Coverage artifact was not available for this run.

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.

fix(providers): a typed connection name that matches an existing cookie connection silently overwrites it (follow-up to #15006)

1 participant