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

fix: table cache #2734

Merged
merged 2 commits into from
May 1, 2024
Merged

fix: table cache #2734

merged 2 commits into from
May 1, 2024

Conversation

Paul-Bob
Copy link
Contributor

@Paul-Bob Paul-Bob commented May 1, 2024

Description

Fixes #2732

Refactor rows and header cache

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works

@Paul-Bob Paul-Bob added the Fix label May 1, 2024
@Paul-Bob Paul-Bob self-assigned this May 1, 2024
Copy link

codeclimate bot commented May 1, 2024

Code Climate has analyzed commit 4e875ad and detected 0 issues on this pull request.

View more on Code Climate.

@Paul-Bob Paul-Bob merged commit 978cc5c into main May 1, 2024
17 of 20 checks passed
@Paul-Bob Paul-Bob deleted the fix/table_cache branch May 1, 2024 21:29
Copy link
Contributor

github-actions bot commented May 1, 2024

This PR has been merged into main. The functionality will be available in the next release.

Please check the release guide for more information.

@adrianthedev
Copy link
Collaborator

Could please leave a message to why this refactor was done?

@Paul-Bob
Copy link
Contributor Author

Paul-Bob commented May 2, 2024

Could please leave a message to why this refactor was done?

Sure, full context on the fixed issue: #2732

Instance variables was defined and assigned inside cache_if block which would not run if result already cached.

We actually want the cache_if block to cache a result and assign to instance variables every time that table component renders.

Pseudo code that explains the refactor:

Before:

cache_if ...
  @variable = value
end

After:

@variable = cache_if ...
  value
end

Makes sense?

@adrianthedev
Copy link
Collaborator

Got it! Thank you!

gabrielgiroe1 pushed a commit that referenced this pull request May 8, 2024
* fiix: table cache

* revert
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Resource index render fails with "#controller can't be used during initialization" error
2 participants