Skip to content

fix(combos): purge combo-scoped proxy assignments when a combo is deleted (#14553) - #14562

Merged
diegosouzapw merged 1 commit into
diegosouzapw:release/v3.8.51from
xiechimon:fix/14553-combo-delete-purges-proxy-assignments
Sep 24, 2026
Merged

diegosouzapw merged 1 commit into
diegosouzapw:release/v3.8.51from
xiechimon:fix/14553-combo-delete-purges-proxy-assignments

Conversation

@xiechimon

Copy link
Copy Markdown
Contributor

What

Fixes #14553. Deleting a combo left orphaned proxy_assignments rows behind: the delete transaction in sqliteComboRepository.ts removed the combos row and the LKGP pins, but never touched the combo's proxy assignments or its proxy_scope_rotation cursor. The dashboard hides the dangling rows (the combo is gone from the list), yet GET /api/settings/proxies/assignments still reports an assignment for a scope_id that no longer exists, and the row counts toward active combo assignments.

How

  • Inside the same delete transaction, drop every proxy_assignments row with scope = 'combo' for the deleted id and clear the combo's rotation cursor via clearRotationState (the existing shared helper from proxies/rotation). This mirrors the account-scope purge that providers/deletion.ts runs on connection delete (fix(backend): deleteProviderConnection leaves proxy_assignments orphan rows #9232).
  • When rows were purged, bump the proxy registry generation so cached resolutions stop serving the deleted combo.
  • The proxy itself stays registered: only the scope link is removed, so other combos/accounts still using that proxy are untouched. Deleting a combo without assignments is unchanged (no purge, no bump).

Verification

No changelog fragment, following the precedent of #14300 and #14291.

AI-assisted: this change was prepared with an AI coding assistant and reviewed line by line by the contributor.

…eted (diegosouzapw#14553)

Deleting a combo removed the combos row and its LKGP pins, but left every
proxy_assignments row with scope='combo' for that combo id behind. The proxy
assignment API kept reporting an assignment for a combo that no longer exists,
and the scope's rotation cursor in proxy_scope_rotation survived too.

The delete transaction now drops the combo's proxy_assignments rows and its
rotation state, mirroring the account-scope purge that runs on connection
deletion (diegosouzapw#9232). When rows were purged the proxy registry generation bumps so
cached resolutions are discarded. The proxy itself stays registered; other
scopes that use it are untouched.

Tests: tests/unit/14553-combo-delete-purges-proxy-assignments.test.ts covers
the purge, survivor isolation, rotation-cursor cleanup, and the generation
bump.
Copilot AI lite review requested due to automatic review settings September 22, 2026 22:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@diegosouzapw

Copy link
Copy Markdown
Owner

Clean fix, and mirroring the existing account-scope purge pattern from #9232 instead of
inventing something new was the right call. Ran the new test suite myself — all 4 cases pass,
including the "survivor combo is untouched" control. Merging as-is.

@diegosouzapw
diegosouzapw merged commit c4d038f into diegosouzapw:release/v3.8.51 Sep 24, 2026
9 of 16 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.

fix(): Deleting a combo leaves orphaned proxy_assignments records

3 participants