Skip to content
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

[Breaking change]: GetAll on services will change behavior in Umbraco 15 #15

Open
2 tasks done
lassefredslund opened this issue May 14, 2024 · 0 comments
Open
2 tasks done

Comments

@lassefredslund
Copy link
Contributor

Description

We'll change GetAll to be a method without any arguments and add a new GetMultiple method that takes an array of keys as an argument. This will be changed on all relevant services.

Version

Umbraco 15

Previous behavior

Today, GetAll receive an array of keys that should be returned, however, if your array is empty, it returns all.

New behavior

GetAll will not have any arguments while GetMultiple will receive an array of keys that should be returned.

Type of breaking change

  • Binary incompatible: Existing binaries may encounter a breaking change in behavior, such as failure to load/execute or different run-time behavior.
  • Source incompatible: Source code may encounter a breaking change in behavior when targeting the new runtime/component/SDK, such as compile errors or different run-time behavior.

Reason for change

It's not obvious, that you get all items if you pass an empty array to GetAll. Much usage of this method passes an array - that might be empty and therefore unintentionally return all elements - which has a significant performance cost. We therfore want to ensure that we only return all elements when this is intended. At the same time, we want to simplify the usage of our services.

Recommended action

Usage of GetAll should be evaluated and either changed to GetMultiple or - if used with an empty array as an argument - changed to GetAll without any parameters.

Affected APIs

All services

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant