fix(api): editing an SSO provider name returns 200 but keeps the old name

Aperta Adatta ai principianti
#8,022 1 commento 1 reazione 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
postgresql, python

Direzione di ricerca

Inizia da OrganizationsService.update_provider in api/ee/src/core/organizations/service.py, che imposta name, slug e description sull'oggetto. Poi leggi OrganizationProvidersDAO.update in api/ee/src/dbs/postgres/organizations/dao.py, che scrive solo flags, secret_id e updated_at. Passa i tre campi e rendili persistenti lì. È completato quando la modifica del nome e la lettura di GET /api/organizations/providers/ restituiscono il nuovo valore, coperto da un nuovo test.

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

Descrizione

What happens

An organization admin edits an SSO provider in Settings > Access and security and changes its name. The save succeeds with HTTP 200 and updated_at changes. But the provider list still shows the old name.

Found during the v0.128.3 staging QA in /m. The request body sent the new name, so the frontend is not the cause.

Steps to reproduce

  1. On an enterprise-plan organization, add an SSO provider.
  2. Edit it and change only the name. Save.
  3. GET /api/organizations/providers/ returns the old name.

Expected

The new name is saved and shown. The same likely applies to slug and description.

Likely cause

OrganizationsService.update_provider (api/ee/src/core/organizations/service.py) sets provider.name, provider.slug and provider.description on the object from dao.get_by_id. Then it calls OrganizationProvidersDAO.update (api/ee/src/dbs/postgres/organizations/dao.py), which loads the row again and writes only flags, secret_id and updated_at. So name, slug and description never reach the database.

Fix

Pass name, slug and description to OrganizationProvidersDAO.update and write them there. Add a test that edits the name and reads it back.

Lingua principale
TypeScript
Stelle
4.8k
Fork
690
Merge medio
23h 29m
PR unite (30g)
540

Preparare l'ambiente

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 Agenta-AI/agenta

Tutte le issue di Agenta-AI/agenta

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.