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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Newsletter templates fixes #6096
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch!!
@decidim/core please, could you merge this PR to prevent this problem? Here are some examples of admin tests failing after 6 hours running: |
@decidim/core we are still having GitHub Actions tasks that are taking 6 hours to fail (you can check it here). I think this PR solves that, can you review it? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent!
* develop: Include year in meetings card (decidim#6102) Add attachment enabled option to initiative types and initiatives (decidim#6036) Fix a flaky test in group profile conversations (decidim#6123) Add attachments to Initiatives (decidim#5844) Add initiatives export (decidim#6070) Improvements to conversations with more than one participant (decidim#6094) Elections module and election administration (decidim#6065) Separate forms in steps (decidim#6108) Add sorting by publishing date to initiatives (decidim#6016) Improve proposal preview: Use proposal card when previewing a proposal draft (decidim#6064) Newsletter templates fixes (decidim#6096) # Conflicts: # decidim-initiatives/app/models/decidim/initiative.rb # decidim-initiatives/spec/system/admin/initiative_types_controller_spec.rb
馃帺 What? Why?
Newsletter templates tests are randomly failing and making the admin component tests to take more than 5 hours to finish. After investigating a lot about that, I didn't find the exact reason for this problem, but it seems to be related with errors when autoloading modules. What I did find is the exact event flow that produces it: when loading the previews for the two templates at the same time the
Decidim::ViewModel
loads three modules that make the server to hang up (Decidim::ActionAuthorization
,Decidim::ActionAuthorizationHelper
andDecidim::ResourceHelper
). This happens in testing and development mode as eager load is disabled.To fix the problem, I've moved the
Decidim::ActionAuthorization
module to thelib
folder and addedautoload
statement for those modules.During the debugging session I've also discovered that the Newsletter's template could be memoized to avoid creating unnecesary ContentBlock, and that templates preview design were broken when the container iframe is too small. So this PR also fix those minor issues.
馃搶 Related Issues
馃搵 Subtasks
CHANGELOG
entry馃摲 Screenshots (optional)
The minor design issue fixed by this PR: