Skip to content

modifyRecords wraps transport failures as .underlyingError instead of .networkError #492

Open

Description

@leogdion

In CloudKitService+WriteOperations.swift, modifyRecords ends with catch { throw CloudKitError.underlyingError(error) }. Every other operation goes through mapToCloudKitError, which unwraps OpenAPIRuntime's ClientError. So when the connection drops during a modify, the caller gets .underlyingError(ClientError) instead of .networkError(URLError), and offline handling misses it.

Fix: written, with a test, in brightdigit/Mistico#91 under Packages/MistKit. It sends the error through mapToCloudKitError(error, context: "modifyRecords") and keeps the quota hint. It will come upstream from the mistico branch.

Found while building brightdigit/Mistico (vendored at Packages/MistKit, branch mistico from v1.0.0-beta.6). Tracked in brightdigit/Mistico#106.

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions