-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Provide generic PaginatedReport Webdav REPORT #26840
Comments
Ah, and I guess the pagination thing would only work properly for |
A few thoughts:
|
The main purpose for pagination here was to be able to paginate on the web UI and mobile clients to save some bandwidth and improve perf. Not sure how using sync-collection there would help. Also I guess that sync-collection wouldn't necessarily return the results in the desired sort order, so at some point the clients would need to sync down all results before being able to display the first page of results. |
@PVince81 yea, you are right. But this falls for me under "a client that does not care about the full result-set" which I think is a legit reason to build this. Point 3 and 4 still stand though. |
Actually 4 is now also less important =) |
I have actually the opposite opinion: It's better to send everything in one request so you have the per-request overhead (and the bad latency) only once. You could parse the retrieved XML as it comes in if you're worried that you need to wait for the full XML to be there. |
This is not really about waiting for the full XML to be there. It's mostly for mobile clients which might have limited bandwidth (cell network) so instead of retrieving 1000 items at once but only show 20 in the UI they can decide to fetch less in a paginated manner. |
Especially on a cell network you're supposed to avoid requests! Apple says: https://developer.apple.com/library/content/documentation/Performance/Conceptual/EnergyGuide-iOS/DeferNetworking.html#//apple_ref/doc/uid/TP40015243-CH18-SW1 "Batch Transactions" Android says: https://developer.android.com/training/efficient-downloads/efficient-network-access.html Figure 2. Relative wireless radio power use for bundled versus unbundled transfers. |
@guruz well as a mobile client you can still choose to retrieve all the results with a PROPFIND instead of REPORT. Or do a REPORT with a big value like 100 or 1000... And if the user really needs to scroll past the 1000 then load the rest afterwards. |
Hey, this issue has been closed because the label (This is an automated comment from GitMate.io. |
I remember @DeepDiver1975 not being happy about a too generic solution. I anyway decided to go with a less generic route with #13915 |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Let's consider this fancy idea: implement a generic PaginatedPropfindReport that works on any collection in any endpoint inside the Sabre tree.
What the report does:
To compute the result, the report does the following:
$node = getNodeForPath()
on the input URL (ex: "files/admin/sub/dir" or "systemtags/$fileId/", etc)$node->getChildren()
and cache the result somewhere for this specific path/endpointThe advantage is that this would work for any endpoint.
The drawback is that it is a bit inefficient because it retrieves all results from the sub-node. Now if we can cache those we might be fine.
One idea to improve this would be to create a new interface
IPaginatedCollection extends ICollection
that provides this method:getChildrenPaginated($offset, $limit)
So if the collection implements that method, the report calls it directly.
If not, then it falls back to use
getChildren()
+ manually cutting out the result.Now this only applies for a flat list of results which are the children.
The nice thing is that it removes the need to implement pagination for any other endpoint.
By extension, if we want to add filters we could add yet another interface
IFilteredCollection
withgetChildrenFiltered(...)
to filter the flat list of results.@DeepDiver1975 @evert what do you think ?
The text was updated successfully, but these errors were encountered: