Menu

#175 Messaging connection migration creates inconsistent credential reservations

open
nobody
None
3 days ago
3 days ago
Anonymous
No

Originally created by: ilyamxx

Problem

Migrated messaging connections can reserve credentials despite belonging to deleted agents, or become impossible to edit because updates change their reservation scope.

Users may receive:

These platform credentials are already assigned within their allowed scope

The conflicting connection may be hidden from normal agent views, leaving no clear recovery path.

Observed incident

On September 8, 2026, I encountered this with the Freor agent:

  1. Updating the existing Slack connection’s credentials failed.
  2. I removed the connection and attempted to create a replacement.
  3. Creation failed with: “These platform credentials are already assigned within their allowed scope.”

The UI did not identify the conflicting connection or provide a recovery action.

This incident prompted the code investigation above. We have not confirmed whether either identified migration defect caused this particular failure.

Root cause

Two inconsistencies exist in the shared connection lifecycle:

  • Migration versus deletion: migration includes soft-deleted agents and creates enabled, non-retired connections from retained credentials. This can restore reservations that deletion previously released.
  • Migration versus editing: migration preserves duplicate credentials using legacy-agent:<id> scopes, but updates unconditionally replace those scopes with global. Even a settings-only edit can then conflict with another connection.

Deleting and recreating the affected connection does not help if another connection still holds the global reservation.

Scope and verification

Both paths affect Slack, Telegram, and Discord in main at bbf77075.

Source inspection and focused in-memory reproductions confirm these mechanisms. Full API/PostgreSQL regression tests remain needed.

Freor’s Slack update/recreation failures prompted this investigation; their exact production cause is not yet confirmed. Teams, tool integrations, and cron delivery are outside this issue.

Expected behavior

  • Deleted agents do not acquire active credential reservations through migration.
  • Ordinary edits do not silently change credential ownership or invalidate migrated connections.
  • Existing affected records have a safe reconciliation path.
  • Conflict errors provide actionable, permission-aware recovery guidance.
  • Regression tests cover deleted-agent migration and editing migrated duplicate credentials across affected platforms.

References

Discussion


Log in to post a comment.