Skip to content

Stale client registration replayed to DCR forever; only --reset recovers #231

Description

@sourman

A valid-but-stale client registration (a client_id the provider no longer accepts) makes mcporter auth <server> fail at the DCR step and replay the same dead registration on every retry. Only --reset recovers.

Reproduced flipping a Supabase GoTrue-backed guard server between two project refs. Stale entries pile up in the vault, and auth dies with:

[cause]: ServerError
    at parseErrorResponse (.../auth.js:132)
    at registerClient (.../auth.js:914)
{ errorUri: undefined }

--reset clears it; the flow then completes and a follow-up auth is a no-op.

On main (710840f), unrecoverableOAuthRefreshCode (oauth-persistence.ts:123) is wired in only at the refresh paths (:643, :729), never at registerClient. And oauthErrorCode (:143) needs a structured code or known error name; the bare ServerError from parseErrorResponse has neither. So a DCR failure never clears the stale client_id. #190 and #208 cover refresh failures and corrupt cache, not this.

Fix, in the spirit of #190: in the auth()/attemptTransportConnect error branch, when cached clientInformation exists and the failure is from registerClient, invalidateCredentials('client') and retry DCR once.

mcporter 0.12.3, Node, Linux.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal priority bug or improvement with limited blast radius.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:auth-providerThis issue is about auth, provider routing, model choice, or SecretRef resolution.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions