Searching user:<username> returns the wrong posts when the username starts with "me"
Los mantenedores suelen responder en 6 días
Nadie ha tomado este issue todavía.
- #1667 de @granbellllc-png — cerrado sin fusionar
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 45/100
Línea de trabajo
The issue identifies the search parser’s strings.Contains(q, "user:me") check and says the bug occurs before search plugins run; it does not name the parser file or an existing test. Start by locating that check and the search parser tests, then verify that user:me still means the current user while user:melissa returns only melissa’s posts. The author says they have a fix and plan to open a pull request, so check for that work before starting.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the bug
The search tips say user:username searches by author. For any username that starts with me (melissa, megan, meng, mei, ...) the search is treated as user:me instead. A visitor gets results from every author, a signed-in user gets only their own posts, and the rest of the username (lissa) is searched as a word.
The search parser checks strings.Contains(q, "user:me") before it looks up the username, so user:melissa matches that check. This happens before the search plugin is called, so it affects the built-in search and the search plugins alike.
To Reproduce
- Create two users,
melissaandbob. - As melissa, ask "Which port does the parking service use". As bob, ask "Where is the store service configuration".
- Search
user:bob: one result, bob's question. - Search
user:melissa: no results. - Search
user:melissa servicewhile signed out: two results, melissa's and bob's question.
I ran this against dev at ec5e0e9 (SQLite, installed with the AUTO_INSTALL environment variables), calling GET /answer/api/v1/search?order=newest the way the search box does:
q='user:bob' as anonymous count 1 authors [bob]
q='user:melissa' as anonymous count 0 authors []
q='user:melissa' as admin count 0 authors []
q='user:melissa service' as anonymous count 2 authors [melissa, bob]
q='user:me' as melissa count 1 authors [melissa]
Expected behavior
user:melissa returns melissa's posts, the same way user:bob returns bob's. Only user:me itself should mean the current user.
Screenshots
None, the output above is from the API.
Platform
- Device: Desktop (API calls with curl)
- OS: Linux (Docker, golang:1.25)
- Browser and version: not used
- Version:
devat ec5e0e9; the same check is onmain
I have a fix with a test and will open a pull request for it.
- Lenguaje dominante
- Go
- Estrellas
- 15.7k
- Forks
- 1.4k
- Merge medio
- 9 d 6 h
- PR fusionados (30 d)
- 8
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de apache/answer
-
Hardening: cap the invite_user list size in UpdateQuestionInviteUser to bound notification fan-outPosiblemente ocupada @TastyHeadphones la tomó hace 47 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
apache/answer#1617 · 1 comentario ·
Los mantenedores suelen responder en 6 días
-
Admin AI settings silently reset the assistant prompt, which cannot be edited in the UIPosiblemente ocupada @Andy-Sverdlov-LucaNet la tomó hace 63 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 6 días
-
🌐 Contribute a translationAbierto
Dificultad 1/5 1-3 horas Aptitud para principiantes 75/100
apache/answer#158 · 16 comentarios ·
Los mantenedores suelen responder en 6 días
-
Server-rendered <time datetime> and JSON-LD dates ignore the site time zone (server-local wall clock labeled as UTC)Posiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 78/100
apache/answer#1669 · 1 comentario ·
Los mantenedores suelen responder en 6 días
-
enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 42/100
Los mantenedores suelen responder en 6 días
Todos los issues de apache/answer
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
bazel-contrib/rules_go#4784 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Уязвимые компоненты в GoAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
POSIdev-community/aictl#40 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
nebari-dev/nebari-infrastructure-core#774 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
oracle/terraform-provider-oci#2662 ·