Skip to content

[Bug]: Denying a T3 Connect device that was already approved reports success and leaves it trusted #38419

Closed

Description

@Umais-Adeed

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

  1. Turn on Require approval for new T3 Connect devices and have two clients signed in with access:write, for example desktop and the phone app.
  2. Connect a new device through T3 Connect. Both clients show the approval prompt with the device's code.
  3. Approve it on desktop.
  4. Within 10 minutes, tap Deny on the prompt still open on the phone.

Expected behavior

Deny on a request someone has already approved reports that the request is no longer waiting, and the device stays in the T3 Connect devices list where it can be revoked.

Actual behavior

The server answers revoked: true, so the phone treats the denial as done and says nothing. The device stays trusted and connected while the user believes they denied it.

Cause: approveConnectRequest in apps/server/src/auth/PairingGrantStore.ts trusts the device key but leaves the request row unspent, because the device's next relay attempt mints a fresh credential once it is trusted (issueConnectCredentialLocked in EnvironmentAuth.ts). The old row stays active for its 10-minute TTL, and the revoke query in apps/server/src/persistence/AuthPairingLinks.ts only checks revoked_at IS NULL AND consumed_at IS NULL, so it "revokes" a request whose device is already trusted.

Impact

Major degradation or frequent failure

Version or commit

main @ a6016e6

Environment

Any platform with T3 Connect device approval enabled and more than one approving client.

Logs or stack traces

Reproduced in the existing EnvironmentAuth.test.ts case "holds an untrusted T3 Connect device until it is approved, and revocation cuts it off" by revoking the request right after approveConnectDevice:

AssertionError: expected true to be false // Object.is equality
 ❯ src/auth/EnvironmentAuth.test.ts:350:68
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions