-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Batch item rest requests #19233
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
base: release/16.0
Are you sure you want to change the base?
Batch item rest requests #19233
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.
Pull Request Overview
This PR introduces batching logic for REST GET requests to work around URL length limitations, by implementing a new controller that handles batched item requests and consolidates results.
- Introduces a new controller for batched API requests using a chunking mechanism.
- Refactors the getItems method in item data sources to utilize the new controller.
- Updates and refactors utility modules (batching functions and tryExecute modules) to support batched execution.
Reviewed Changes
Copilot reviewed 36 out of 36 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
src/Umbraco.Web.UI.Client/src/packages/data-type/repository/item/data-type-item.server.data-source.ts | Refactored getItems to use the new UmbItemDataApiGetRequestController for batching item requests. |
src/Umbraco.Web.UI.Client/src/packages/core/utils/array/batch-array.ts & test | Added batching helpers and tests. |
src/Umbraco.Web.UI.Client/src/packages/core/resources/try-execute/* | Updated import paths and consolidated try-execute functions. |
src/Umbraco.Web.UI.Client/src/packages/core/entity-item/* | Added new controller for batched API GET requests and updated related types and indexes. |
Other files | Adjusted exports and import paths for consistency with the new batching implementation. |
Comments suppressed due to low confidence (1)
src/Umbraco.Web.UI.Client/src/packages/data-type/repository/item/data-type-item.server.data-source.ts:9
- [nitpick] The PR description refers to the controller as 'UmbItemDataApiRequestController', but the code uses 'UmbItemDataApiGetRequestController'. Consider aligning the naming for clarity.
import { UmbItemDataApiGetRequestController } from '@umbraco-cms/backoffice/entity-item';
Are there any plans to add this fix into v15? |
Hi @PeterKvayt, not currently, but maybe you can share your perspective for this? — It's also worth mentioning that we currently have no plans for v.15.5 — but are open to making v15.5 if there is a good case to cover. Generally, v.16 is a small major, a few breaking changes regarding the front-end, but despite that, it should be an easy upgrade, so I hope you would consider going that direction? Let me know where you stand, thanks in advance |
@madsrasmussen code changes looks good to me, I have not tested it yet. |
Fixes:
#19187
#18822
When making a REST GET request, the server has a limitation on the length of a URL. To accommodate this limitation, this PR introduces batching logic for item requests. I have added a new controller,
UmbItemDataApiRequestController
. I am open to naming suggestions if something else comes up.The controller takes an array of unique items and cuts it into chunks based on a configured chunk size. It then sends a request to the provided API endpoint. The controller combines the returned data and presents it as one unified data set. It also handles errors and notifies if any of the requests fail.
The controller has been implemented for all item repositories.