[feature] Invalidate VPN cache when organization config variables change #1177
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When organization configuration variables are updated, VPN cache wasn't being invalidated automatically. This caused VPNs to use stale config data leading to connectivity issues.
Added signal handler to detect context changes in OrganizationConfigSettings and trigger cache invalidation for all VPNs in that organization. Also added comprehensive tests to ensure the functionality works correctly.
Fixes #1098
Checklist
Reference to Existing Issue
Closes #1098.
Description of Changes
organization_config_settings_change_handlerinhandlers.pyto detect when OrganizationConfigSettings context field changesinvalidate_organization_vpn_cacheCelery task intasks.pyto invalidate VPN cache for all VPNs in the affected organizationapps.pytest_organization_vpn_cache.pycovering signal handling, task execution, and edge casesThe implementation ensures VPN cache is automatically invalidated whenever organization configuration variables change, preventing stale configuration issues.
Screenshot
Not applicable - this is a backend functionality change with no UI components.