Skip to content

Fix FreeMarkerLoginFormsProvider calling handleThemeResources twice p…#49719

Merged
rmartinc merged 1 commit into
keycloak:mainfrom
maeventer:fix/49718-double-handleThemeResources
Jun 9, 2026
Merged

Fix FreeMarkerLoginFormsProvider calling handleThemeResources twice p…#49719
rmartinc merged 1 commit into
keycloak:mainfrom
maeventer:fix/49718-double-handleThemeResources

Conversation

@maeventer

Copy link
Copy Markdown
Contributor

…er render

Fixes #49718

getMessage() in createCommonAttributes() internally called formatMessage(FormMessage), which re-resolved theme and locale from scratch via handleThemeResources(). This caused a redundant load of the message bundle (theme.getEnhancedMessages) and theme properties (theme.getProperties) on every login page render.

Replace getMessage() with the direct formatMessage(message, messagesBundle, locale) overload, using the already-resolved bundle and locale already available as parameters in createCommonAttributes().

@maeventer
maeventer requested a review from a team as a code owner June 5, 2026 11:48
@maeventer
maeventer force-pushed the fix/49718-double-handleThemeResources branch from dac58e5 to d0eb59b Compare June 5, 2026 12:34

@keycloak-github-bot keycloak-github-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unreported flaky test detected, please review

@keycloak-github-bot

Copy link
Copy Markdown

Unreported flaky test detected

If the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR.

org.keycloak.testsuite.adapter.servlet.SAMLServletAdapterTest#salesPostTest

Keycloak CI - Adapter IT Strict Cookies

org.opentest4j.AssertionFailedError: expected: <true> but was: <false>
	at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
	at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
	at org.junit.jupiter.api.AssertTrue.failNotTrue(AssertTrue.java:63)
	at org.junit.jupiter.api.AssertTrue.assertTrue(AssertTrue.java:36)
...

Report flaky test

org.keycloak.testsuite.adapter.servlet.SAMLServletAdapterTest#testMultipleTabsParallelLogin

Keycloak CI - Adapter IT Strict Cookies

org.awaitility.core.ConditionTimeoutException: Assertion condition defined as a Lambda expression in org.keycloak.testsuite.util.URLAssert URL expected to begin with: https://localhost:8543/auth/realms/demo/login-action ; actual URL: https://localhost:8643/sales-post/ ==> expected: <true> but was: <false> within 10 seconds.
	at org.awaitility.core.ConditionAwaiter.await(ConditionAwaiter.java:167)
	at org.awaitility.core.AssertionCondition.await(AssertionCondition.java:119)
	at org.awaitility.core.AssertionCondition.await(AssertionCondition.java:31)
	at org.awaitility.core.ConditionFactory.until(ConditionFactory.java:1160)
...

Report flaky test

@rmartinc rmartinc self-assigned this Jun 8, 2026
@rmartinc

rmartinc commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Thanks @maeventer! I'm going to rebase your branch to include the issue about FIPS that was fixed last Friday. The change is OK for me. Let's see the tests after the rebase.

@rmartinc
rmartinc force-pushed the fix/49718-double-handleThemeResources branch from d0eb59b to f11c206 Compare June 8, 2026 14:41
@rmartinc

rmartinc commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

One more thing, Can you please add the signature for the commit? (you can just do git commit -s --amend to include your email). If not the DCO is going to fail.

@rmartinc

rmartinc commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

@maeventer Okis, tests pass now. So as you add the signature this is ready to go. Thanks!

@maeventer

Copy link
Copy Markdown
Contributor Author

Great, thanks @rmartinc for taking care of it

@maeventer
maeventer force-pushed the fix/49718-double-handleThemeResources branch from a4a4e7e to f5c718e Compare June 9, 2026 05:44
…er render

Signed-off-by: maeberl <markus.eberl@eventim.de>

@rmartinc rmartinc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @maeventer!

@rmartinc
rmartinc merged commit 7dd3fc8 into keycloak:main Jun 9, 2026
88 checks passed
sashyo pushed a commit to tide-foundation/keycloak-IGA that referenced this pull request Jul 20, 2026
…er render (keycloak#49719)

Signed-off-by: maeberl <markus.eberl@eventim.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FreeMarkerLoginFormsProvider: handleThemeResources called twice per request due to getMessage() in createCommonAttributes

2 participants