Fix create_new_library existence check to use safe_name#1211
Open
majiayu000 wants to merge 1 commit intollmware-ai:mainfrom
Open
Fix create_new_library existence check to use safe_name#1211majiayu000 wants to merge 1 commit intollmware-ai:mainfrom
majiayu000 wants to merge 1 commit intollmware-ai:mainfrom
Conversation
Move safe_name transformation before check_if_library_exists to ensure both the existence check and library creation use the same transformed name. Previously, check_if_library_exists was called with the secure_filename result, but the library was created with the safe_name result. If these two transformations produced different names, the existence check would fail to find the library even if it already existed. Fixes llmware-ai#1155 Signed-off-by: majiayu000 <1835304752@qq.com>
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.
Summary
safe_nametransformation beforecheck_if_library_existscallProblem
In
create_new_library, the existence check was performed using thesecure_filenameresult, but the library was created using thesafe_nameresult. If these two transformations produced different names, the existence check would fail to find an existing library.Solution
Apply
safe_nametransformation earlier in the function, before callingcheck_if_library_exists, so both operations use the same final name.Test Plan
Fixes #1155