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

IBX-3075: Switched to loading all choices at once for ContentCreate form #950

Closed
wants to merge 1 commit into from

Conversation

mnocon
Copy link
Contributor

@mnocon mnocon commented Oct 19, 2023

JIRA: https://issues.ibexa.co/browse/IBX-3075

obraz

Please look at the JIRA ticket to learn more about this issue - there's a reproducer that I've used to test that with my changes it doesn't occur anymore.

This is the most common issue triggering Behat failures (because we run the tests in parallel) and that's why I've started investigating it.

Without this change the ContentCreateContentTypeChoiceLoader::loadChoiceList method is called 6 times (looks like the Form is created 2 times and there are 3 calls per Form).

After this change the call is made 2 times (once per Form).

This is my first interaction with the Form component - so while I was able to see what's going on (my diagnosis: for a single Form the ContentCreateContentTypeChoiceLoader::loadChoices method is called multiple times - and because the Content Types are changed in the background there is a mismatch between values returned from the calls made for single Form) I'm not sure if this is the right solution. From what I've read in the doc it doesn't look like we're filtering the values in a way that's benefiting from lazy loading them (but I might be wrong 😄 ) and using the ChoiceLoader might not be necessary here.

I've attached the Blackfire profiles (before and after) in the Jira ticket - so you can verify the number of calls I've mentioned.

TODO:

  • check if the Content Types are still filtered based on permissions

@sonarcloud
Copy link

sonarcloud bot commented Oct 19, 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

@mnocon
Copy link
Contributor Author

mnocon commented Oct 23, 2023

Replaced by ibexa/behat#91

@mnocon mnocon closed this Oct 23, 2023
@mnocon mnocon deleted the content-create-type-replace-choice-loader branch October 23, 2023 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant