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

Do not disable optimized Sling Alias resolution by default #29

Merged

Conversation

stefanseifert
Copy link
Member

@stefanseifert stefanseifert commented Dec 7, 2023

Since release 4.1.4 we've set to resource.resolver.optimize.alias.resolution=false for the Resource Resolver Factory by default in unit tests, although this is not the Sling default. Having it enabled did/does not work with actual alias resolution in unit test context.

Starting with Sling Resource Resolver 1.11.2 a WARN is logged that this "unoptimized code path" is flawed and will be removed in a future version. So we should not disable it by default.

So, since release 5.4.4 we've enabled by default for Resource Resolver:

  • resource.resolver.optimize.alias.resolution=true
  • resource.resolver.enable.vanitypath=true

With this setting, sling:alias resolution is fully supported using JCR_OAK resource resolver type. You have to keep in mind the sling:alias is processed asynchronously, see example test.

As a downside, sling:alias is no longer supported with JCR_MOCK resource resolver type, because that does not support JCR Observation events. You can still switch to the old behavior by setting resource.resolver.optimize.alias.resolution=false explicitly, see example test - but this relies on deprecated functionality.

@stefanseifert stefanseifert changed the title Do not disable resource.resolver.optimize.alias.resolution by default Do not disable optimized Sling Alias resolution by default Dec 7, 2023
Copy link

sonarcloud bot commented Dec 7, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@stefanseifert stefanseifert merged commit b35d383 into develop Dec 7, 2023
7 of 8 checks passed
@stefanseifert stefanseifert deleted the feature/resource.resolver.optimize.alias.resolution branch December 7, 2023 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant