Searching user:<username> returns the wrong posts when the username starts with "me"
Maintainer thường phản hồi trong vòng 6 ngày
Chưa có ai nhận issue này.
- #1667 của @granbellllc-png — đã đóng, không merge
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 45/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Go
- Star
- 15.7k
- Fork
- 1.4k
- Merge trung bình
- 9 ngày 6 giờ
- Pull request đã merge (30 ngày)
- 8
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của apache/answer
-
Hardening: cap the invite_user list size in UpdateQuestionInviteUser to bound notification fan-outCó thể đã có người làm @TastyHeadphones đã nhận 47 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
apache/answer#1617 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 6 ngày
-
Admin AI settings silently reset the assistant prompt, which cannot be edited in the UICó thể đã có người làm @Andy-Sverdlov-LucaNet đã nhận 63 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 6 ngày
-
🌐 Contribute a translationĐang mở
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 75/100
apache/answer#158 · 16 bình luận ·
Maintainer thường phản hồi trong vòng 6 ngày
-
Server-rendered <time datetime> and JSON-LD dates ignore the site time zone (server-local wall clock labeled as UTC)Có thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 78/100
apache/answer#1669 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 6 ngày
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 42/100
Maintainer thường phản hồi trong vòng 6 ngày
Tất cả issue của apache/answer
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
bazel-contrib/rules_go#4784 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Уязвимые компоненты в GoĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
POSIdev-community/aictl#40 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
nebari-dev/nebari-infrastructure-core#774 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
oracle/terraform-provider-oci#2662 ·