Skip to content

chore(storage): declare request_cancellation as implemented - #1330

Merged
grdsdev merged 2 commits into
mainfrom
lukasklingsbo/storage-request-cancellation-matrix
Sep 14, 2026
Merged

chore(storage): declare request_cancellation as implemented#1330
grdsdev merged 2 commits into
mainfrom
lukasklingsbo/storage-request-cancellation-matrix

Conversation

@spydon

@spydon spydon commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Summary

`storage.file_buckets.request_cancellation` was marked `not_implemented` while `database.using_modifiers.request_cancellation` and `functions.invocation.request_cancellation` are declared `implemented` for the same mechanism: cancellation is plain Swift structured concurrency, there is no dedicated symbol to register.

Storage goes through the same path. `StorageHTTPSession` wraps the async `URLSession` data and upload calls, which honor Task cancellation, and the shared `RetryRequestInterceptor` checks `Task.isCancelled` after its backoff sleep. This flips the storage entry to `implemented` with the same note the other two modules carry.

Verification

A scratch executable pointed `SupabaseStorageClient` at a non-routable address with a 120 second URLSession timeout, started an `upload` and a `download` in their own Tasks, and cancelled both after 300 ms. Each threw `NSURLErrorDomain -999 "cancelled"` at roughly 320 ms instead of waiting out the timeout.

No test is added here. SDK-1640 tracks adding a mid-request and mid-backoff cancellation test for the shared transport, which covers storage as well.

Storage rides the same URLSession and retry interceptor path as database
and functions, so cancelling the enclosing Task tears down an in-flight
upload or download. The matrix marked it not_implemented while the
other two modules were declared implemented for the same mechanism.
@spydon
spydon requested review from a team and grdsdev as code owners September 11, 2026 12:54
@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 033b9994-d2e9-401a-b5c9-aa0b9578be26

📥 Commits

Reviewing files that changed from the base of the PR and between e4351ed and 628c29c.

📒 Files selected for processing (1)
  • sdk-compliance.yaml
💤 Files with no reviewable changes (1)
  • sdk-compliance.yaml

Included review availability: Your plan provides up to 4 included reviews per hour; 2 remain after this review.


📝 Summary

Summary by CodeRabbit

  • New Features
    • File bucket requests now support cancellation during in-progress transfers.
    • Cancelling the enclosing task stops the active transfer and retry process.

Walkthrough

The compliance manifest now marks storage.file_buckets.request_cancellation as implemented. A comment documents that cancellation uses Swift structured concurrency by cancelling the enclosing Task. It also states that URLSession terminates the in-flight transfer and the retry loop observes Task.isCancelled. No public declarations changed.

Priority: ⬇️ Low

Change: Other

Merge Risk: ⚪ Minimal · up to 628c2

The manifest-only capability status update has no identified merge-blocking risk.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coveralls

coveralls commented Sep 11, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 34602536649

Warning

Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes.
Quick fix: rebase this PR. Learn more →

Coverage decreased (-0.2%) to 87.418%

Details

  • Coverage decreased (-0.2%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 20 coverage regressions across 2 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

20 previously-covered lines in 2 files lost coverage.

File Lines Losing Coverage Coverage
Sources/RealtimeV2/WebSocket/URLSessionWebSocket.swift 17 63.98%
Sources/Helpers/JSONValue/JSONValue.swift 3 97.35%

Coverage Stats

Coverage Status
Relevant Lines: 11032
Covered Lines: 9644
Line Coverage: 87.42%
Coverage Strength: 91.87 hits per line

💛 - Coveralls

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Capability matrix drift detected

The following capabilities are marked implemented in the matrix but could not be found in swift:

  • client.session_management.persist_session → expected symbol: AuthLocalStorage.defaultLocalStorage
  • functions.invocation.streaming_response → expected symbol: FunctionsClient._invokeWithStreamedResponse

The following capabilities are marked implemented in swift but have no registered symbols to verify:

  • auth.passkey.register_passkey (no symbols list — cannot confirm implementation exists)
  • auth.passkey.sign_in_with_passkey (no symbols list — cannot confirm implementation exists)
  • client.observability.trace_propagation (no symbols list — cannot confirm implementation exists)
  • database.using_modifiers.request_cancellation (no symbols list — cannot confirm implementation exists)
  • functions.invocation.request_cancellation (no symbols list — cannot confirm implementation exists)
  • storage.file_buckets.url_cache_nonce (no symbols list — cannot confirm implementation exists)
  • storage.file_buckets.request_cancellation (no symbols list — cannot confirm implementation exists)

These may have been renamed, removed, or never registered. Please update the capability matrix.
See: https://github.com/supabase/sdk/blob/main/packages/capability-matrix/docs/capability-matrix.md

@grdsdev
grdsdev merged commit d5cd74f into main Sep 14, 2026
30 checks passed
@grdsdev
grdsdev deleted the lukasklingsbo/storage-request-cancellation-matrix branch September 14, 2026 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants