Skip to content

Bug: WalletContext.signTx adds an abort listener to the global AbortController on every call and never removes it on normal completion #374

Description

@Jaydbrown

contexts/WalletContext.tsxsignTx:

const globalAbortCleanup = () => { operationAbortController.abort(); };
abortControllerRef.current?.signal.addEventListener('abort', globalAbortCleanup, { once: true });

{ once: true } removes the listener only if abort actually fires. On the normal path (sign succeeds, no disconnect) the listener is never removed, and abortControllerRef.current persists for the whole connected session (it's only replaced on disconnect).

Impact

Every signTx call permanently adds a listener to the session-long AbortController. A user who signs many transactions in one session accumulates hundreds of dead closures (each retaining an AbortController + closure scope) until they disconnect. Slow leak; matches the class of #234 / #275 / #355.

Suggested fix

Remove the listener in a finally (or signal.removeEventListener) once the operation settles.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programbugSomething isn't workingpriority: mediumMissing feature or UX issue

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions