Closed hackerwins closed 3 months ago
[!WARNING]
Review failed
The pull request is closed.
The changes improve how documents are handled in a server-backend database by filtering out removed documents both in memory and MongoDB queries. Tests have been updated to create projects and documents more effectively, and variable names have been streamlined for clarity. Additionally, HTTP POST request handling is now refactored to a dedicated function, simplifying test cases.
Files/Paths | Change Summary |
---|---|
server/backend/database/memory/database.go |
Added a check to skip removed documents in the FindDocInfosByQuery method. |
server/backend/database/mongo/client.go |
Added a MongoDB query filter to exclude documents with removed_at field. |
test/helper/helper.go |
Introduced a new function CreateProjectAndDocuments to create projects and documents. |
test/integration/admin_test.go |
Renamed adminCli2 to cli for clarity and updated references accordingly. |
test/integration/restapi_test.go |
Refactored test logic, updated HTTP request handling, and introduced a new post function. |
In memory's grasp, removed docs hide,
Mongo's filter, a silent guide.
With tests refined and more precise,
New functions rise, so smooth and nice.
For code that's clear, our goal attained,
The rabbit's dance, its joy unfeigned. 🐇
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
What this PR does / why we need it:
Prevent exposure of removed documents when searching
Removed documents were being exposed when searching in Dashboard. This commit modifies to prevent exposure by adding a filter to the query.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
Additional documentation:
Checklist:
Summary by CodeRabbit
Bug Fixes
Tests