-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(core): Adds Pagination to StreamGetBranches and increases limit requested by DUI #2440
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would advise against this solution.
The api call should be "pure", meaning it does 1 call when you run it, not potentially 100s. It should be the responsibility of the project using this method to implement pagination on their end.
☝🏼 This would require adding a cursor input to this call, which I'd be happy to have.
If this is something commonly done in many connectors, we should create a separate function to get N branches while safely handling all other server considerations, but leave StreamGetBranches
untouched.
var res = await ExecuteGraphQLRequest<StreamData>(request, cancellationToken).ConfigureAwait(false); | ||
branches.AddRange(res.stream.branches.items); | ||
nextCursor = res.stream.branches.cursor; | ||
} while (branches.Count < branchesLimit && nextCursor != null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This while loop is questionable, depending on the inputs it could hit our rate-limit quite easily.
That makes sense. I can review. The idea here would be to do that call recursion in DUI. Thanks |
Agree with Alan :) It also sounds more of a UI/UX problem; how would people deal with 100+ branches in the current DUI? |
7def8d8
to
a0eb5a2
Compare
a0eb5a2
to
06e61e2
Compare
This is a UI/UX problem that exists in both Connectors and the web. The specific use case I have referred to in Notion cc-ing @teocomi Aside from the reporting user, we see increasing numbers of users with catalogue-like approaches to their Speckle data management. cc @paloknapo Where users have greater than 100 branches to a stream, these will be accessible online by URL at least until this may be supported. In connectors, you cannot reach your data. #2437 Suggests a further enhancement to DUI as a UX solution for many branches. An alternative consideration is to have a "fetch more branches" button. |
I've refactored this content away
Closing as currently blocked by specklesystems/speckle-server#1549 - will reopen/revisit when the right time comes. |
Closes: #2436
Description & motivation
Allows for use cases heard from Speckle users requiring more than 100 branches as they address cataloguing or complex team information management. The server allows a maximum of 100 results per query; the current solution takes this as a hard limit.
Changes:
Core / API / GraphQL / Client.BranchOperations :: StreamGetBranches
DUI2 / ViewModels / StreamViewModel
Validation of changes:
Rhino and Navisworks both tested against https://speckle.xyz/streams/01fca0eab7
Checklist: