You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
swift-sdk: follow-ups from #5146 — test error assertions, typed contract-fetch errors, one off-main executor #5303
Follow-ups from the review of #5146 (Swift SDK Platform queries off the caller's actor). None of them blocks that PR; they are collected here so they land together.
PlatformQueryOffMainTests accepts any error. The four catch {} blocks (packages/swift-sdk/SwiftTests/SwiftDashSDKTests/PlatformQueryOffMainTests.swift, around line 62) would still pass if a query bailed out before reaching the FFI — e.g. performBlockingQuery throwing .invalidState because the handle read as nil on the queue thread. Assert the error is not .invalidState (or is the mock's missing-expectation error), so the doc comment's "marshal arguments and make the FFI call" is enforced.
Contract-fetch errors lose their type. In PlatformQueryExtensions.swift, documentListJSON's contract-fetch error path (and the same pattern around lines 462 and 682) collapses the FFI error into .internalError, while the search half goes through consumeStringResult and keeps the code — a transport failure surfaces as .networkError/.timeout on one half and not the other. Use SDKError.fromDashSDKError(error.pointee) on both. Pre-existing, not introduced by fix(sdk): run blocking Swift SDK Platform queries off the caller's actor #5146.
Two off-main executors with opposite policies.dataContractQueue (serial, to bound blocked threads) and the concurrent executor behind performBlockingQuery each argue against the other in their doc comments. With every rs-sdk-ffi live-handle entry point now borrowing the SDK wrapper shared, route dataContractGetOffMain through performBlockingQuery, keeping one policy and one place that documents the thread-cost trade-off.
Activity