Skip to content

Replace dummy-message biometric pre-auth with explicit ensureUnlocked()#40

Draft
Copilot wants to merge 2 commits intochen/fix-errorhandlingfrom
copilot/sub-pr-38-again
Draft

Replace dummy-message biometric pre-auth with explicit ensureUnlocked()#40
Copilot wants to merge 2 commits intochen/fix-errorhandlingfrom
copilot/sub-pr-38-again

Conversation

Copy link
Contributor

Copilot AI commented Mar 14, 2026

GaslessManager.ensureBiometricAuth() was calling signMessage("auth:purpose") to unlock the vault and cache the public key before transaction building. For VaultSigner in PerOperation mode this caused two biometric prompts per operation; for custom signers it produced an unnecessary signature.

Changes

  • TransactionSigner interface — Added suspend fun ensureUnlocked() with a default no-op. Vault-backed signers override it for explicit pre-authentication without producing a signature.

  • VaultSigner — Implements ensureUnlocked(): performs one biometric prompt, caches the public key, and (PerOperation mode) stores the keypair as a single-use pendingKeypair. signMessage() consumes pendingKeypair when present, skipping the second unlock:

    // PerOperation: ensureUnlocked() stores keypair; signMessage() consumes it once
    val keypair = pendingKeypair?.also { pendingKeypair = null }
        ?: VaultManager.unlockVault(/* prompts user */ ...)

    SessionBased mode continues to rely on VaultManager's TTL session cache.

  • GaslessManagerensureBiometricAuth() now delegates to signer.ensureUnlocked(). Removed the now-meaningless purpose: String parameter from the helper and all six call sites.


📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.

…mmy signMessage

Co-authored-by: mocolicious <6373607+mocolicious@users.noreply.github.com>
Copilot AI changed the title [WIP] [WIP] Address feedback on error handling improvements Replace dummy-message biometric pre-auth with explicit ensureUnlocked() Mar 14, 2026
Copilot AI requested a review from mocolicious March 14, 2026 06:44
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.

2 participants