Skip to content

Passkey auto-sync is cancelled when provider activity finishes #98

Description

@pando85

Describe the bug

After a successful passkey create or authentication ceremony, AppPasskeyProviderActivity starts GitOp.SYNC in its lifecycleScope and then immediately calls finish(). Destroying the activity cancels the scope before the Git operation completes.

This makes passkey auto-sync unreliable. In particular, a newly created passkey may remain local instead of being pushed for another compatible authenticator to discover.

Observed logcat output after successful create and authentication ceremonies:

Passkey auto-sync crashed: kotlinx.coroutines.JobCancellationException: Job was cancelled

To Reproduce

  1. Configure APS with a Git remote.
  2. Leave passkey automatic Git sync enabled.
  3. Register a passkey with APS, or authenticate using an existing passkey.
  4. Complete the WebAuthn ceremony successfully.
  5. Observe that the provider activity finishes while the sync starts.
  6. Observe the JobCancellationException in logcat before the Git sync completes.

Expected behavior

Automatic Git synchronization started by a successful passkey ceremony should survive the transient provider activity finishing and complete reliably. A successful sync should also run the existing repository/index invalidation callback.

The sync should preferably run as durable application-level work rather than delaying the WebAuthn response while network I/O completes.

Command output

Passkey auto-sync crashed: kotlinx.coroutines.JobCancellationException: Job was cancelled; job=SupervisorJobImpl{Cancelling}

Additional context

  • APS version: 1.19.1 (11901)
  • Reproduced from commit d9a81442
  • Relevant code: app/src/main/java/app/passwordstore/passkeys/AppPasskeyProviderActivity.kt
  • maybeSyncToGit() launches with lifecycleScope.launch(...).
  • Both successful create and get paths call maybeSyncToGit() immediately before finish().
  • This was found while verifying bidirectional credential compatibility between APS and Passless.
  • APS not pulling Git before Credential Manager candidate discovery is a separate concern and is intentionally not included in this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions