Skip to content

feat(storage): add cacheNonce parameter for cache invalidation#970

Merged
grdsdev merged 2 commits intomainfrom
claude/affectionate-jennings-eea1f3
Apr 23, 2026
Merged

feat(storage): add cacheNonce parameter for cache invalidation#970
grdsdev merged 2 commits intomainfrom
claude/affectionate-jennings-eea1f3

Conversation

@grdsdev
Copy link
Copy Markdown
Contributor

@grdsdev grdsdev commented Apr 23, 2026

Summary

  • Adds optional cacheNonce: String? parameter to createSignedURL, createSignedURLs, getPublicURL, and download methods
  • When provided, appends cacheNonce=<value> as a query parameter to the generated URL for cache invalidation
  • Defaults to nil, so no breaking changes to existing callers

Changes

  • StorageFileApi.swift: Added cacheNonce parameter to all four URL-generating methods and the private makeSignedURL helper
  • StorageFileAPITests.swift: Added 4 unit tests covering cacheNonce behaviour on each method

Testing

Test Coverage

  • testCreateSignedURL_cacheNonce — verifies cacheNonce=abc123 appended to signed URL
  • testCreateSignedURLs_cacheNonce — verifies cacheNonce=abc123 appended to each signed URL in batch
  • testGetPublicURL_cacheNonce — verifies cacheNonce=abc123 appended to public URL
  • testDownload_cacheNonce — verifies cacheNonce=abc123 appended to download request

All 4 new tests pass. All existing StorageTests continue to pass.

Risk Assessment

  • Breaking changes: None — cacheNonce defaults to nil
  • Backward compatibility: Fully maintained
  • Performance impact: Negligible

Acceptance Criteria

  • cacheNonce parameter added to all URL-generating storage methods
  • Query parameter correctly appended to URLs
  • Unit tests
  • No breaking changes

Linear Issue

Closes: SDK-884


🤖 Generated with Claude Code /take

Add optional cacheNonce parameter to createSignedURL, createSignedURLs,
getPublicURL, and download methods. When provided, the value is appended
as a cacheNonce query parameter to the generated URL, enabling cache
invalidation. Matches the supabase-js v2.103.0+ API.

Linear: SDK-884

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@grdsdev grdsdev requested a review from a team April 23, 2026 09:18
@grdsdev grdsdev enabled auto-merge (squash) April 23, 2026 13:03
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@grdsdev grdsdev merged commit 6397521 into main Apr 23, 2026
23 of 24 checks passed
@grdsdev grdsdev deleted the claude/affectionate-jennings-eea1f3 branch April 23, 2026 13:29
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.

2 participants