Skip to content

Fix: Plugin Cache Invalidation (#800)#1128

Merged
utksh1 merged 2 commits into
utksh1:mainfrom
diksha78dev:fix/issue-800
Jun 20, 2026
Merged

Fix: Plugin Cache Invalidation (#800)#1128
utksh1 merged 2 commits into
utksh1:mainfrom
diksha78dev:fix/issue-800

Conversation

@diksha78dev

Copy link
Copy Markdown
Contributor

Description

This PR refactors the cache invalidation logic by moving it into cache.py to prevent circular dependencies. It introduces invalidate_plugin_caches() to ensure that plugin and dashboard summary caches are correctly cleared whenever plugin states change. Additionally, it adds a try-except RuntimeError block around cache retrievals to gracefully handle scenarios where the cache is not initialized (such as in certain unit testing environments).

Related Issues

Fixes #800

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

How Has This Been Tested?

  • Updated testing/backend/test_cache_invalidation.py to verify both invalidate_view_cache and the new invalidate_plugin_caches.
  • Added a specific test test_load_plugins_invalidates_cache to mock and verify that plugin cache invalidation is correctly triggered during plugin loading.
  • Ensured backwards compatibility by verifying invalidate_view_cache remains importable from routes.py.

To reproduce the test results, run:
pytest testing/backend/test_cache_invalidation.py

Checklist

  • My code follows the code style of this project.
  • 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.
  • My changes generate no new warnings.

@utksh1 utksh1 added level:intermediate 35 pts difficulty label for moderate contributor PRs type:bug Bug fix work category bonus label area:backend Backend API, database, or service work labels Jun 20, 2026

@utksh1 utksh1 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Focused change with green checks; approving.

@utksh1 utksh1 merged commit 8c23678 into utksh1:main Jun 20, 2026
19 checks passed
@utksh1 utksh1 added the gssoc:approved Admin validation: approved for GSSoC scoring label Jun 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:backend Backend API, database, or service work gssoc:approved Admin validation: approved for GSSoC scoring level:intermediate 35 pts difficulty label for moderate contributor PRs type:bug Bug fix work category bonus label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TASK] Invalidate cache namespaces after plugin metadata refresh

2 participants