Skip to content

Fix n+1 query on assemblies permissions#12040

Merged
andreslucena merged 3 commits intodevelopfrom
fix/query-optimization
Nov 21, 2023
Merged

Fix n+1 query on assemblies permissions#12040
andreslucena merged 3 commits intodevelopfrom
fix/query-optimization

Conversation

@alecslupu
Copy link
Copy Markdown
Contributor

@alecslupu alecslupu commented Nov 20, 2023

🎩 What? Why?

This PR is aiming to optimize the assembly controller, which is misbehaving when there is a big number of assemblies, by scoping a small number of assemblies instead of all each time.

📌 Related Issues

Link your PR to an issue

Testing

The pipeline should be green on relevant actions.

  1. Login as admin and visit admin area
  2. Using the seeds class, generate a big number of assemblies ( you can only create the assembles, not the entire script), we could use ~200
  3. Visit admin area and see how is the interface acting
  4. Apply patch
  5. See improvement

♥️ Thank you!

Copy link
Copy Markdown
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

This pull request does not contain a valid label. Please add one of the following labels: ['type: feature', 'type: change', 'type: fix', 'type: removal', 'target: developer-experience', 'type: internal']

@alecslupu alecslupu added module: assemblies type: fix PRs that implement a fix for a bug labels Nov 20, 2023
github-actions[bot]
github-actions bot previously approved these changes Nov 20, 2023
@alecslupu alecslupu changed the title Optimize query on asseblies page Optimize query on assemblies page Nov 21, 2023
github-actions[bot]
github-actions bot previously approved these changes Nov 21, 2023
@alecslupu alecslupu marked this pull request as ready for review November 21, 2023 07:17
@alecslupu alecslupu requested review from a team and fblupi November 21, 2023 07:17
@andreslucena andreslucena changed the title Optimize query on assemblies page Fix n+1 query on assemblies permissions Nov 21, 2023
Copy link
Copy Markdown
Member

@andreslucena andreslucena left a comment

Choose a reason for hiding this comment

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

Tried it locally and it works great!

I tried to add some specs to detect this but couldn't find a fast way, so I guess we're good to merge this one.

If you can come up with a way of testing this (using bullet or any of the gems that we already have), it would be great.

I'm merging this in either case. Thanks for the fix!

@andreslucena andreslucena merged commit 282b229 into develop Nov 21, 2023
@andreslucena andreslucena deleted the fix/query-optimization branch November 21, 2023 08:26
@andreslucena
Copy link
Copy Markdown
Member

This needs to be backported to v0.27 only, as it was introduced with #8773

entantoencuanto added a commit that referenced this pull request Nov 27, 2023
* develop: (51 commits)
  Fix a11y violations and title layout on announcements (#12067)
  Fix randomness on nickname and emails for seeded users (#12058)
  Fix render partial deprecation warning on proposals (#12035)
  Redesign: proposal counter total number avaliable (#12014)
  Fix disabling access to space private users when the space is public (#12031)
  Redesign: admin screen overflow on smaller screens (#11956)
  Make the breadcrumb consistent in the components import pages (#12024)
  Fix develop branch (#12051)
  Create the IconRegistry (#11982)
  Fix process groups component content blocks (#11872)
  Remove the asemblies settings page (#11873)
  Fix n+1 query on assemblies permissions (#12040)
  Remove unused scope filter from search controller and command (#12038)
  Fix issues in "Verify your identity" (#12030)
  Fix flash of dropdowns in buttons from the title bar and "Manage" button (#12011)
  Add CI workflow configuration for decidim-design (#12022)
  Extract methods from participatory processes seeds (#12032)
  Show message when there are no debates (#12037)
  Show error message when there are no budgets nor projects in budgets (#12034)
  Fix faker requirement in production environment 2 (#12033)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module: assemblies type: fix PRs that implement a fix for a bug

Projects

No open projects
Archived in project

Development

Successfully merging this pull request may close these issues.

Poor performance on assemblies admin page

2 participants