llmware-ai / llmware-ai/llmware

Library.create_new_library checks existence wrong

Open
#1,155 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
14.8k
Forks
2.9k
PR merge metrics
No merged PRs in 30d

Description

The create_new_library method first checks the existence of the library, and then creates the library only if it does not exist.
However, when checking existence, it uses library_name, while when creating it uses safe_name. If the library_name is not equal to the safe_name, the next time the library existence check will not succeed, however creation of the library would also fail - because the function attempts to create a different name.

The correct logic would be to convert the library name to the safe name as early as possible, and conduct further manipulations (checking existence etc.) with the safe name.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the Python implementation of Library.create_new_library and trace how library_name and safe_name are used during the existence check and creation. Confirm the behavior with a library name that is transformed into a different safe name, then add or update a regression test if the repository has coverage for this method; done means existence checks and creation use the same name.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.