Repository navigation
refactor(storage): page every Storage list the same way - #917
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Every paged Storage list now returns one page type,
Supabase.Storage.Common.Page<T>, and every list option pages with the same two names.Page<T>(Storage/Common/Page.cs): a sealed record withIReadOnlyList<T> Items(empty by default, never null) andstring? NextPageToken(null means this is the last page).VectorListPage<TItem>,IcebergNamespacePageandIcebergTablePage.ListVectorBucketsAsync,ListIndexesAsyncandListVectorsAsyncreturnPage<VectorBucketSummary>,Page<VectorIndexSummary>andPage<StoredVector>.ListNamespacesAsyncandListTablesAsyncreturnPage<IcebergNamespace>andPage<IcebergTable>.ListVectorBucketsOptions,ListVectorIndexesOptions,ListVectorsOptions:MaxResults→PageSize,NextToken→NextPageToken.ListNamespacesOptions,ListTablesOptions:PageToken→NextPageToken.<example>on all five list methods uses the samedo/whileloop. The old examples dropped the first page's items.All of this surface is in
PublicAPI.Unshipped.txt, so nothing shipped changes.PublicAPI.Shipped.txtis byte-identical.Paging loop, before and after
Vectors, before:
Iceberg, before (no paging loop was possible with the same shape: different page type, item property and option name):
After, the same loop for both:
The wire does not change
Only the C# names change. The internal bodies, responses and queries still use
maxResults/nextTokenfor vectors, andpageSize/pageToken/next-page-tokenfor Iceberg. No approval.verified.txtsnapshot changed, and every contract-test URL assertion is unchanged.Helper placement (CONVENTIONS §2)
PathSegmentstays inStorage/Common/.FileBuckets/Common/BucketLifecyclePathno longer repeats its blank and relative-segment checks and calls it instead, so two domains use it. The request URL is unchanged. TheArgumentExceptionmessage for a bad lifecycle bucket id now uses PathSegment's wording (A bucket id must be provided./A bucket id cannot be a relative path segment.). The existing test pins only theA bucket id*prefix, so it still passes as is.QueryStringmoved fromStorage/Common/toAnalyticsBuckets/Common/.ListAnalyticsBucketsQueryno longer repeats its Append/Parameter logic and calls it instead, so its users are the analytics bucket list and the Iceberg namespace and table lists. The output is byte-identical, including the trailing?when no option is set. I kept that?on purpose, so URLs stay exactly as they are.What remains in
Storage/Common/, and who uses it:Page<T>PathSegmentOut of scope
QueryVectorsAsyncstill usesQueryVectorsOptions.NextToken/VectorQueryResult.NextToken. It is a similarity query, not a list, and returnsVectorQueryResult, not a page.Verification
gate.sh packages/Storage: Build, Format, Inner loop (752 passed) and Public API declared all PASS. The result is INCOMPLETE locally because the Supabase stack was down (E2E/coverage skipped), so CI is the gate. As expected, the public-API diff signal reports REMOVED entries, all of them for unshipped members.🤖 Generated with Claude Code