Skip to content

Conversation

@MattBudz
Copy link
Contributor

Summary

This PR fixes a bug where the issues table would not show an accurate list of affected nodes after an affected node has been renamed or merged.

Check List

  • Added a CHANGELOG entry

@MattBudz MattBudz changed the title Issues/show updated affected list Ensure the Affected column in Issues#index is updated when an affected node is renamed or merged Jun 26, 2024
@@ -1,4 +1,4 @@
<% cache ['issues-table', @all_columns, issues.map(&:id), @issues.map(&:updated_at).map(&:to_i).sort.last, @tags] do %>
<% cache ['issues-table', @all_columns, issues.map(&:affected), issues.map(&:id), @issues.map(&:updated_at).map(&:to_i).sort.last, @tags] do %>
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need this change? If only 1 node is updated, then the whole table's cache busts. Maybe we can go with just the per-issue caching change

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Without this change, the table doesn't show the correct affected column because the cache isn't busted. Do we need to cache the table if we are caching each row?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah looks like I'm mistaken and the inner fragment caching are preserved and not busted: https://guides.rubyonrails.org/caching_with_rails.html#russian-doll-caching

Copy link
Member

Choose a reason for hiding this comment

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

@aapomm why is the outer cache key change needed then? Affected is always defined as a column.

MattBudz and others added 2 commits June 27, 2024 16:03
instead we are just keeping the updated_at value which will be enough to bust the cache

Co-authored-by: Aaron Manaloto <mail@aapomm.io>
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.

4 participants