Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT]: Improve API remove documents /v1/system/remove-documents #1895

Open
byzheng opened this issue Jul 19, 2024 · 1 comment
Open

[FEAT]: Improve API remove documents /v1/system/remove-documents #1895

byzheng opened this issue Jul 19, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@byzheng
Copy link

byzheng commented Jul 19, 2024

How are you running AnythingLLM?

AnythingLLM desktop app

What happened?

This is a following question (#1894). But I think it would be better to separately report.

After adding a new document with document/raw-text API, I want to remove this document with /system/remove-documents. There is some trouble to remove this document with names property in the DELETE request.

If id is used (i.e. 99502983-20fa-4cd1-bef5-e17cd0c56dae, I get an success response, but the document is still in the workspace.

Then I test the name retrieved from document api, i.e. raw-title-99502983-20fa-4cd1-bef5-e17cd0c56dae.json or ``

Are there known steps to reproduce?

No response

@byzheng byzheng added the possible bug Bug was reported but is not confirmed or is unable to be replicated. label Jul 19, 2024
@timothycarambat
Copy link
Member

You will always get a 200 unless there is a server error:
ref:

response.sendStatus(200).end();

However, the correct path to put in is the folder + filename - the 200 will return even if the document is not found or deleted to prevent people trying to traverse or remove all documents.

In this case the document should be something like custom-documents/raw-title-99502983-20fa-4cd1-bef5-e17cd0c56dae - however this kind of nature for deletion should be revisited to be more trivial since it is indeed quite unclear.

@timothycarambat timothycarambat added enhancement New feature or request and removed possible bug Bug was reported but is not confirmed or is unable to be replicated. labels Jul 22, 2024
@timothycarambat timothycarambat changed the title [BUG]: API remove documents /v1/system/remove-documents [FEAT]: Improve API remove documents /v1/system/remove-documents Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants