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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Newsletter templates fixes #6096

Merged
merged 6 commits into from May 25, 2020
Merged

Newsletter templates fixes #6096

merged 6 commits into from May 25, 2020

Conversation

leio10
Copy link
Contributor

@leio10 leio10 commented May 13, 2020

馃帺 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 and Decidim::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 the lib folder and added autoload 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

  • Add CHANGELOG entry

馃摲 Screenshots (optional)

The minor design issue fixed by this PR:
imagen

@leio10 leio10 requested a review from mrcasals May 13, 2020 16:40
Copy link
Contributor

@mrcasals mrcasals left a comment

Choose a reason for hiding this comment

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

Nice catch!!

@leio10
Copy link
Contributor Author

leio10 commented May 14, 2020

@decidim/core please, could you merge this PR to prevent this problem? Here are some examples of admin tests failing after 6 hours running:

@leio10
Copy link
Contributor Author

leio10 commented May 25, 2020

@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?

@jesusdb jesusdb self-requested a review May 25, 2020 14:44
Copy link
Contributor

@jesusdb jesusdb left a comment

Choose a reason for hiding this comment

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

Excellent!

@jesusdb jesusdb merged commit 7f7bd65 into develop May 25, 2020
@jesusdb jesusdb deleted the fix/cells_race_conditions branch May 25, 2020 14:46
ace pushed a commit to aspgems/decidim that referenced this pull request May 27, 2020
* 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
@mrcasals mrcasals mentioned this pull request May 27, 2020
2 tasks
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.

None yet

3 participants