Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

SearchOrganizations answers internal when filtering on name

Aperta Adatta ai principianti
#1,979 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
go, postgresql
Ambito
api, backend

Direzione di ricerca

Inizia da internal/store/postgres/org_billing_repository.go in addRQLFiltersInQuery, la cui allow list non contiene name, poi confrontalo con lo schema RQL su AggregatedOrganization. Controlla anche la mappatura di postgres.ErrBadInput nell'handler, così che un filtro non supportato restituisca invalid_argument. È fatto quando i filtri su name funzionano, oppure i campi non supportati restituiscono invalid_argument con un messaggio chiaro, e non viene restituito alcun internal.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Go
Stelle
344
Fork
48
Merge medio
1g 22h
PR unite (30g)
38

Preparare l'ambiente

  • Include un Dockerfile o un file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di raystack/frontier

Tutte le issue di raystack/frontier

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.