• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

supabase / supabase-swift / 25346544606

04 May 2026 10:16PM UTC coverage: 80.515%. First build
25346544606

Pull #988

github

grdsdev
fix(storage): address issues 4 5 7 8 10 11 12 14

Issue 4 – open FileHandle once per TUS upload
UploadSource gains openForReading() and readChunk(at:maxSize:fileHandle:).
TUSUploadEngine.uploadChunks opens the handle before the loop and passes it
to every readChunk call, eliminating one open/seek/close per chunk for
fileURL sources.

Issue 5 – LockIsolated in SequentialMockProtocol
Replace NSLock + nonisolated(unsafe) vars with a single
LockIsolated<MockState>. All mutable decisions (shouldHang, callIndex,
capturedRequests) are now made atomically inside withValue; the hang
continuation is captured under the lock and yielded outside, removing the
race between startLoading and reset().

Issue 7 – mapResult cancel race
Add resultContinuation.finish() to the mapResult cancel closure so
newResultTask always exits via the continuation stream (StorageError.cancelled)
rather than via Task cancellation (CancellationError), making the error type
deterministic.

Issue 8 – remove redundant Content-Length header in TUS PATCH
URLSession.upload(for:from:) sets Content-Length automatically; the explicit
setValue was dead code.

Issue 10 – test for cancel during .creating state
HangingMockProtocol gains hangPostRequests flag. New test
cancelDuringCreateEmitsCancelledEvent verifies that cancelling while the POST
creation request is in flight emits .failed(.cancelled).

Issue 11 – document Int.max fallback in upload/update fileURL overloads
DocC comment now explains that when resourceValues fails the SDK falls back to
TUS as a safe conservative default.

Issue 12 – defer temp-file cleanup in downloadData
Replace the manual removeItem after Data(contentsOf:) with a defer block so
the file is always removed even if the read throws.

Issue 14 – explicit hangWhenExhausted ordering in resumeAfterPause test
Move hangWhenExhausted = true to immediately after sequentialClientWithChunkSize
(which calls reset()) with a comment, making the reset-then-set ordering
explicit rather ... (continued)
Pull Request #988: feat(storage): add TUS resumable uploads, background downloads, and multipart upload engine

801 of 986 new or added lines in 8 files covered. (81.24%)

7814 of 9705 relevant lines covered (80.52%)

28.76 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

86.25
/Sources/Storage/StorageFileAPI.swift


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc