Skip to content

Dead code: XCResultFile.exportPayload never returns nil #388

Description

@tylervick

XCResultKit.XCResultFile.exportPayload(id:) returns its temp path unconditionally — the underlying exportAttachment is @discardableResult and its failure is never checked.

So the guard let savedURL = file.exportPayload(id: id) else { … } fault branches in ResultFile.exportPayload and exportPayloadData are unreachable. Every genuine export failure actually surfaces later, as the moveItem throw.

Task: either remove the dead branches, or (better) detect real export failure properly — checking that the temp file exists and is non-empty before attempting the move. Relates to the --legacy migration issue, since that will change this API surface anyway.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions