feat(synapse-sdk): expose paginated client dataset queries in WarmStorageService#717
Merged
hugomrdias merged 2 commits intoApr 14, 2026
Conversation
8dcf2c0 to
2c4a880
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates WarmStorageService in synapse-sdk to expose the new paginated client dataset query actions added in synapse-core, enabling consumers to query client datasets using offset/limit and retrieve dataset counts/IDs.
Changes:
- Extended
getClientDataSetsto accept optionaloffset/limitfor paginated reads. - Added
getClientDataSetsLengthandgetClientDataSetIdswrappers to expose total count and paginated ID reads. - Refactored
getClientDataSetsWithDetailsto fetch dataset IDs via the new core action instead of a directreadContractcall.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Collaborator
|
@hugomrdias can you review this PR? |
2c4a880 to
0b8b732
Compare
- Fix JSDoc to use `0n` instead of `0` for bigint parameters - Use OutputType aliases for return type consistency - Implement chunked pagination in getClientDataSetsWithDetails to avoid unbounded response size - Use wrapper method internally for consistency - Add comprehensive tests for pagination methods
hugomrdias
reviewed
Apr 14, 2026
Comment on lines
+165
to
+183
| const totalDataSets = await this.getClientDataSetsLength({ address }) | ||
| if (totalDataSets === 0n) return [] | ||
|
|
||
| // Fetch IDs in chunks to avoid unbounded response size | ||
| const pageSize = 100n | ||
| const ids: bigint[] = [] | ||
|
|
||
| for (let offset = 0n; offset < totalDataSets; offset += pageSize) { | ||
| const remaining = totalDataSets - offset | ||
| const limit = remaining < pageSize ? remaining : pageSize | ||
| const pageIds = await this.getClientDataSetIds({ | ||
| address, | ||
| offset, | ||
| limit, | ||
| }) | ||
|
|
||
| if (pageIds.length === 0) break | ||
| ids.push(...pageIds) | ||
| } |
Member
There was a problem hiding this comment.
@rvagg any reason we didnt use the hasMore pattern from pdp-verifier for these new methods ?
hugomrdias
approved these changes
Apr 14, 2026
anjor
added a commit
to anjor/pynapse
that referenced
this pull request
Apr 18, 2026
Mirrors FilOzone/synapse-sdk#717. - get_client_data_sets now accepts offset/limit and uses the paginated view overload. Default offset=0, limit=0 returns the full list. - Adds get_client_data_set_ids(client, offset, limit) backed by the view contract's clientDataSets ID-only accessor. - Adds get_client_data_sets_length(client) wrapping getClientDataSetsLength. Available on both SyncWarmStorageService and AsyncWarmStorageService.
1 task
anjor
added a commit
to anjor/pynapse
that referenced
this pull request
Apr 18, 2026
Mirrors FilOzone/synapse-sdk#717. - get_client_data_sets now accepts offset/limit and uses the paginated view overload. Default offset=0, limit=0 returns the full list. - Adds get_client_data_set_ids(client, offset, limit) backed by the view contract's clientDataSets ID-only accessor. - Adds get_client_data_sets_length(client) wrapping getClientDataSetsLength. Available on both SyncWarmStorageService and AsyncWarmStorageService.
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.
Summary
Exposes the paginated client dataset actions from synapse-core (#698) in
WarmStorageService, enabling consumers to useoffset/limitfor dataset queries.Changes
packages/synapse-sdk/src/warm-storage/service.tsgetClientDataSets— Added optionaloffset/limitparameters to support paginated queriesgetClientDataSetIds— New method wrappinggetClientDataSetIdsfrom synapse-core, returns dataset ID arrays with optional paginationgetClientDataSetsLength— New method wrappinggetClientDataSetsLengthfrom synapse-core, returns total dataset count for a clientgetClientDataSetsWithDetails— Refactored to usegetClientDataSetIdsinstead of rawreadContractcallRelated
with this in place
Closes #691