Skip to content

fix(auth): never sign as a conflicting source when the pin is missing - #3094

Draft
aristidesstaffieri wants to merge 1 commit into
feat/account-mgmt-v2from
fix/signer-fallback-link-status
Draft

aristidesstaffieri wants to merge 1 commit into
feat/account-mgmt-v2from
fix/signer-fallback-link-status

Conversation

@aristidesstaffieri

@aristidesstaffieri aristidesstaffieri commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

What

When the pinned source isn't held, getSigningIdentity now picks the fallback signer by link status: a held source the server listed as linked, then one it hasn't answered for yet, with phrases first in each tier. It never signs with a source the server reported as a conflict, and if only those are held it returns null so requests go out anonymously. It still never writes the pin. New tests cover each tier, the all-conflict case, and a held pin that has no status.

Why

The fallback signed with the first held source. If the server had marked that source as another user's, every request would resolve to that user and the analytics reconcile from stellar/freighter-private#69 would cache their canonical id. The link status map from stellar/freighter-private#68 already records which sources are in this wallet's cluster, so the fallback can rank by it without another request. This covers the conflict half of the re-pin that stellar/freighter-private#66 asked for. Today the pinned source goes missing only when it fails to derive at unlock, since recovery wipes the wallet and nothing removes accounts.

Screenshots / video

N/A, background only.

Checklist

  • I have read CONTRIBUTING.md and this PR meets its requirements.
  • This PR has narrow scope and does not mix refactoring with feature changes.
  • This PR adds tests for the new functionality or fixes.
  • These changes have been tested in both Chrome and Firefox.
  • This PR includes relevant before and after screenshots for UI changes.
  • I took the time to review my own PR.

@aristidesstaffieri aristidesstaffieri self-assigned this Nov 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

PR Preview build is ready: https://github.com/stellar/freighter/releases/tag/untagged-d46934ab57f8ae4cdd0b
Backend: sandbox (aristidesstaffieri). SDF collaborators only — install instructions in the release description.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues were identified for the fallback signer-selection change.

No open issues 🎉

What changed in this PR

This PR makes Freighter’s background authentication fallback safer when the pinned signing source is unavailable, preventing fallback requests from signing as a source marked as belonging to another user.

Changes:

  • Prefer held sources marked linked, then sources without a recorded status, preserving phrase-first ordering within each tier.
  • Return null when every held source is marked conflict, without changing the pin.
  • Add tests for fallback selection, all-conflict behavior, and a held pin without a recorded status.
File Description
extension/​src/​background/​helpers/​signing-identity.ts Rank fallback signers by link status and exclude conflicting sources.
extension/​src/​background/​helpers/​__tests__/​signing-identity.test.ts Test fallback priorities, conflict exclusion, and held-pin behavior.

Review effort: Balanced

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