unsloth/studio/frontend/src/features/chat/api
Daniel Han a226b7e7e9
Studio: reconcile external providers across browsers after delete (#5698)
Deleting a connection in one browser left the same connection stuck in
every other browser/tab. The user could not delete or edit it from there
because the local state never caught up with the server, and clicks
either no-op'd or threw on a missing-row backend response.

Two pieces caused the bug:

1. `ChatProvidersSettings` ran its backend sync once on mount and then
   silently kept localStorage providers whenever `listProviderConfigs`
   returned an empty array, on the assumption that an empty server
   response had to be a transient glitch. That assumption is wrong when
   another browser removed the last connection. With the guard gone,
   trust any successful API response, including an empty list. A focus /
   visibilitychange listener now triggers a silent re-sync so the dialog
   does not need to be closed and reopened to pick up remote deletes.

2. `deleteProviderConfig` threw on HTTP 404, so once Browser A deleted a
   connection, Browser B's "Delete" click failed and the local row stuck
   around. Treat 404 as success: the server's job is already done and
   the local cache only needs to be pruned.
2026-05-22 06:42:39 -07:00
..
chat-adapter.ts Studio: persist chat history in backend storage (#5272) 2026-05-22 06:18:05 -07:00
chat-api.ts Studio: persist chat history in backend storage (#5272) 2026-05-22 06:18:05 -07:00
chat-settings-api.ts Studio: persist chat history in backend storage (#5272) 2026-05-22 06:18:05 -07:00
openai-containers.ts studio/frontend: wire logout, singleflight refresh, shared 422 helper, current-password input (#5490) 2026-05-18 00:03:03 -07:00
providers-api.ts Studio: reconcile external providers across browsers after delete (#5698) 2026-05-22 06:42:39 -07:00