Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

SearchOrganizations answers internal when filtering on name

Đang mở Phù hợp với người mới
#1,979 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đá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
72/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
go, postgresql
Lĩnh vực
api, backend

Hướng nghiên cứu

Bắt đầu ở internal/store/postgres/org_billing_repository.go tại addRQLFiltersInQuery, nơi danh sách cho phép thiếu name, sau đó so sánh với schema RQL trên AggregatedOrganization. Cũng kiểm tra ánh xạ postgres.ErrBadInput trong handler để bộ lọc không được hỗ trợ trả về invalid_argument. Hoàn thành khi bộ lọc name hoạt động, hoặc các trường không được hỗ trợ nhận invalid_argument kèm thông báo rõ ràng, và không trả về internal.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

What happens

AdminService.SearchOrganizations answers internal (HTTP 500) when the query filters on name.

Example request body:

{"query": {"filters": [{"name": "name", "operator": "eq", "string_value": "my-org"}]}}

The server log says addRQLFiltersInQuery: name is not supported in filters. Filtering on title or state works.

Why

  • name is a valid field of AggregatedOrganization (rql:"name=name"), so the request passes rql.ValidateQuery in the handler.
  • addRQLFiltersInQuery in internal/store/postgres/org_billing_repository.go has its own allow list. It has id, title, state, created_at, plan_name, subscription_state, subscription_cycle_end_at, plan_interval and payment_mode. It has no name, and it also leaves out other fields that the RQL schema allows, such as created_by, country, plan_id, updated_at and avatar.
  • The error it returns is a plain error. The handler only maps postgres.ErrBadInput to invalid_argument, so the client gets internal for what is really a bad request.

Expected

  • Either support filtering on name (and the other fields the RQL schema lists), or reject the unsupported fields in the handler as invalid_argument with a clear message.
  • In both cases an unsupported filter should not answer internal.

How it was found

Found while testing organization delete against a local sandbox. It has nothing to do with deletes, and it behaves the same on main.

Ngôn ngữ chính
Go
Star
344
Fork
48
Merge trung bình
1 ngày 22 giờ
Pull request đã merge (30 ngày)
38

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

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của raystack/frontier

Tất cả issue của raystack/frontier

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.