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

TCK Challenge: <ui:repeat> save state not required by specification #1757

Closed
brideck opened this issue Dec 7, 2022 · 12 comments
Closed

TCK Challenge: <ui:repeat> save state not required by specification #1757

brideck opened this issue Dec 7, 2022 · 12 comments
Labels
accepted Accepted certification request challenge TCK challenge

Comments

@brideck
Copy link
Contributor

brideck commented Dec 7, 2022

Challenged Tests:
ee.jakarta.tck.faces.test.servlet30.ajax.Issue3833IT#testUIRepeatStateSaving

TCK Version:
Jakarta Faces 4.0.x

Tested Implementation:
Open Liberty -- containing MyFaces 4.0

Description:
The challenged test covers scenarios involving the saving and restoring of component state within <ui:repeat> elements, a behavior that does not seem to be required by the Faces specification as far as we can see. This test is another instance of one that was created in response to a Mojarra issue with no corresponding change driven into the specification.

MyFaces has never received a JIRA from a user in this space, and therefore has never implemented the function that would be needed for this test. Saving the required state would consume additional memory and CPU, just in order to provide function that no MyFaces user has ever requested and that the spec doesn't seem to require. As such, MyFaces wishes to have this test removed from the TCK rather than be required to degrade its performance.

There's even a comment by Leo Uribe that used to be in the MyFaces code stating "I haven't found any use case that require to store the rowStates in the component state, mostly because EditableValueHolder instances render the value into the client and then this value are taken back at the beginning of the next request." Similarly, a blog post by Leo raises the similar point that Faces should be striving to keep the state small: "That's the reason why h:dataTable or ui:repeat create just one component and share it for all rows: to keep state small and view rendering fast." The post details alternatives for Faces users who might seek this sort of functionality.

@pnicolucci pnicolucci added the challenge TCK challenge label Dec 7, 2022
@BalusC
Copy link
Member

BalusC commented Dec 9, 2022

Discussion understood but there need to be a distinction of 2 different things:

  1. saving/restoring state of UIRepeat component itself (e.g. begin, end, var, etc)
  2. saving/restoring state of EditableValueHolder children nested in UIRepeat (submitted value, etc)

1 should indeed not be needed at all. MyFaces doesn't do this, but Mojarra indeed unnecessarily does this.
2 is however needed and the test tests exactly this. Mojarra indeed unnecessarily saves a copy of their state in UIRepeat itself but this is in turn unrelated to the fact that the test case should pass regardless of how the implementation deals with the use case.

Best what I could do is to rename the test case to e.g. testUIRepeatDescendantStateSaving and clarify somewhere that it's referring to context explained in 2.

@tandraschko
Copy link

@BalusC is 2) really a real world case?
i just wonder as i'm using MF since ~15 years and never had any issues with inputs in ui:repeat - also we didnt have any issue reports regarding this

@BalusC
Copy link
Member

BalusC commented Dec 10, 2022

It must be said that it really surprised me that this specific test fails in MyFaces. I can take a closer look.

@BalusC
Copy link
Member

BalusC commented Dec 10, 2022

@brideck
Copy link
Contributor Author

brideck commented Dec 12, 2022

I think what's at issue here is whether this is a case that is worthy of being in the TCK. It was a Mojarra reported bug, and Mojarra handled it, but that doesn't necessarily mean that other implementations need to deal with it as well.

@BalusC
Copy link
Member

BalusC commented Dec 13, 2022

I meant to say that there should be a way to fix the issue without the need to save the row index state of UIRepeat itself. This information is already present in the client ID represented by ajax source param.

@pnicolucci
Copy link
Contributor

@BalusC @tandraschko just following up here. Any updates on a path forward?

@pnicolucci
Copy link
Contributor

Since we've never had any reported issues in MyFaces for this and it isn't clear from the spec if this should be supported or not can we accept and exclude the test?

@pnicolucci
Copy link
Contributor

@arjantijms any thoughts?

@pnicolucci
Copy link
Contributor

pnicolucci commented Jan 24, 2023

We discussed this on the platform call today and I'm going to accept this challenge and merge the PR that excludes this test. Fyi, @arjantijms and @BalusC

@pnicolucci pnicolucci added the accepted Accepted certification request label Jan 24, 2023
pnicolucci added a commit that referenced this issue Jan 24, 2023
ignore Issue3833IT#testUIRepeatStateSaving for challenge #1757
@pnicolucci
Copy link
Contributor

Closing as completed now that the test is excluded.

@arjantijms
Copy link
Contributor

Thanks @pnicolucci for taking the initiative!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted Accepted certification request challenge TCK challenge
Projects
None yet
Development

No branches or pull requests

5 participants