fix: stop file-based execution after snippet deactivation - #562
Open
robertstaddon wants to merge 3 commits into
Open
robertstaddon wants to merge 3 commits into
robertstaddon wants to merge 3 commits into
Conversation
Flush the snippet object cache before writing the on-disk index, force the snippet inactive, and replace indexes on rebuild so a deactivated snippet cannot stay marked active. Fixes codesnippetspro#561 Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
|
Ideally, I would initially add a test that check file-based execution for deactivated snippets. The test should fail. In a separate PR, which fixes the issue, the test should no longer fail. |
Author
|
Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #561
Changes
get_snippet()indeactivate_snippet(), and set the snippet inactive before the file-based deactivate hook runs.$snippet->active = falseinSnippet_Files::deactivate_snippet()so a stale cached object cannot be written intoindex.phpas still active.Verification
deactivate_snippet()order is still present oncore-beta.php/index.phprecorded the snippet as inactive. Rebuilding the files did not mark it active again.Made with Cursor