Repository navigation
Bind build time decisions to the view which recorded them - #6191
Merged
Merged
Conversation
BuildTimeDecisions held one set of decisions per request. Building another view in the same request, such as a mail template built in an action via ViewDeclarationLanguage.buildView, discarded the decisions of the current view. The render-time re-apply was then checked against the decisions of the other view and skipped, so a dynamic ui:include kept rendering its old src. Regression of #5960 (56442e4), since 4.0.23. Keep the decisions per UIViewRoot in a request-scoped map, and check a view against its own decisions only. A view without a recorded build is never skipped. A nested build resumes the build it interrupted. With com.sun.faces.restoreBuildTimeDecisions enabled, a build of a view other than the view root no longer records into, nor replays from, the saved state of the view root. The view root is taken from the innermost FacesContext, because OmniFaces' TemporaryViewFacesContext returns the temporary view as its view root. Fixes #6189 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #6189
BuildTimeDecisionsheld one set of decisions per request. Building another view in the same request (e.g. OmniFacesComponents.buildView()for a mail template, or plainViewHandler.createView()+ViewDeclarationLanguage.buildView()in an action) discarded the decisions of the current view. At render,canSkipTransientBuildRefresh()then checked the decisions of the other view and skipped the re-apply, so a dynamic<ui:include src="#{bean.step}">kept rendering the old include.Changes:
UIViewRootin a request-scoped map, andreproducesBuild(context, view)checks a view against its own decisions only. A view without a recorded build is never skipped. An empty set still allows the skip, so static views keep the gain of Skip the render-time re-apply when the build's decisions still hold #5960.begin/endreplacereset, so a nested build resumes the build it interrupted.com.sun.faces.restoreBuildTimeDecisionsenabled, a build of a view other than the view root no longer records into, nor replays from, the saved state of the view root. The view root is taken from the innermostFacesContext, because aFacesContextWrappersuch as OmniFaces'TemporaryViewFacesContextreturns the temporary view as its view root.Tests:
BuildTimeDecisionsTest: a view is checked against its own decisions only; a view without a recorded build is not reproduced; a nested build resumes the interrupted one; a build of another view is recognized through a wrapper.SavedBuildTimeDecisionsTest: a build of another view neither replays, stops the replay, nor is saved.test/issue6189: the include follows the step after ajax postbacks, with and without building another view in the action. It fails on 4.0 without this fix and passes with it.The upmerge to 4.1 and 5.0 follows after merge.
🤖 Generated with Claude Opus 5.5