Bug
Searching with only NIP-50 extensions like language:bg (no base search term) returns no results.
Steps to reproduce
- Search:
language:bg
- Expected: Bulgarian-language notes
- Actual: No results in Bg / results in e.g. English
Root cause
The query parsing pipeline extracts NIP-50 extensions (language:bg) from the query string, leaving an empty cleaned string. The empty string is falsy, so the search field is never set on the filter — the extensions are silently dropped.
Flow:
extractNip50Extensions("language:bg") → { cleaned: "", extensions: { language: "bg" } }
cleaned is empty → falsy → search field omitted from filter
buildSearchQueryWithExtensions("", { language: "bg" }) would produce "language:bg" but is never called
Fix
buildSearchQueryWithExtensions already handles empty base queries correctly (returns "language:bg"). The call site needs to pass "" instead of skipping when the base query is empty:
const searchQuery = buildSearchQueryWithExtensions(baseSearch || '', nip50Extensions) || undefined;
Note: This is already fixed on the perf/fixes-with-benchmarks branch (commit f640633).
Bug
Searching with only NIP-50 extensions like
language:bg(no base search term) returns no results.Steps to reproduce
language:bgRoot cause
The query parsing pipeline extracts NIP-50 extensions (
language:bg) from the query string, leaving an empty cleaned string. The empty string is falsy, so the search field is never set on the filter — the extensions are silently dropped.Flow:
extractNip50Extensions("language:bg")→{ cleaned: "", extensions: { language: "bg" } }cleanedis empty → falsy → search field omitted from filterbuildSearchQueryWithExtensions("", { language: "bg" })would produce"language:bg"but is never calledFix
buildSearchQueryWithExtensionsalready handles empty base queries correctly (returns"language:bg"). The call site needs to pass""instead of skipping when the base query is empty:Note: This is already fixed on the
perf/fixes-with-benchmarksbranch (commitf640633).