Some small Labrinth refactors and fixes (#3698)

* chore(labrinth): fix typos, simplify out `remove_duplicates` func

* fix(labrinth): implement `capitalize_first` so that it can't panic on wide chars

* chore(labrinth): refactor out unneeded clone highlighted by nightly Clippy lints

* chore(labrinth): simplify `capitalize_first` implementation

* fix(labrinth): preserve ordering when deduplicating project field values

This addresses an unintended behavior change on
157647faf2778c74096e624aeef9cdb79539489c.

* fix(labrinth/tests): make `index_swaps` test run successfully

I wonder why we don't run these more often...

* refactor: rename `.env.example` files to `.env.local`, make local envs more consistent between frontend and backend

* chore(labrinth/.env.local): proper email verif. and password reset paths
This commit is contained in:
Alejandro González
2025-05-29 22:51:30 +02:00
committed by GitHub
parent be37f077d3
commit a9cfc37aac
10 changed files with 36 additions and 48 deletions

View File

@@ -151,7 +151,7 @@ async fn index_swaps() {
test_env.api.remove_project("alpha", USER_USER_PAT).await;
assert_status!(&resp, StatusCode::NO_CONTENT);
// We should not get any results, because the project has been deleted
// Deletions should not be indexed immediately
let projects = test_env
.api
.search_deserialized(
@@ -160,7 +160,8 @@ async fn index_swaps() {
USER_USER_PAT,
)
.await;
assert_eq!(projects.total_hits, 0);
assert_eq!(projects.total_hits, 1);
assert!(projects.hits[0].slug.as_ref().unwrap().contains("alpha"));
// But when we reindex, it should be gone
let resp = test_env.api.reset_search_index().await;