Skip to content

execute() on an owner-invalidated injected session crashes with an uncatchable NSException #1516

Description

@jkmassel

Split out from #1497Swift executor URLSession error audit. Section D — Crash instead of classified error.

File references are to native/swift/Sources/wordpress-api/SafeRequestExecutor.swift unless noted; :NNN line numbers were verified against fix/converge-executor-error-classification.

Severity: low. After the session owner calls invalidateAndCancel, the next execute()/upload() calls session.dataTask/uploadTask on the invalidated session, which raises Foundation's "task created in a session that has been invalidated" NSException — uncatchable from Swift. Requires caller misuse; worth a doc note that the injected URLSession must outlive the executor (or track didBecomeInvalidWithError and fail fast with GenericError). Incidentally, this lens confirmed the .cancelled → CancellationError mapping is honest: the library's own two cancel paths and an in-flight invalidateAndCancel all funnel there, and the challenge handler never returns .cancelAuthenticationChallenge, so no non-cancellation source of .cancelled exists in this executor. ✅

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions