#316 — [Bug]: bdstate API sends notifications without checking WS connection

Repo: Twill-AI/facade State: closed | Status: done Assignee: Unassigned

Created: 2025-04-02 · Updated: 2025-09-15

Description

Steps to reproduce

  1. Login under user, close browser tab without logging out.
  2. Call “bdstate” API to send notification.
  3. Check logs for errors.

Expected behavior

No errors, notification is saved to be shown later.

Actual behavior

logs:

2025-04-01 12:25:32.104|ERROR|master|fastapi_utils:304|FINISH POST http://ca-staging-twill-facade-eastus/api/v1/master/bdstate/tenants/zxcktkofq1/bdintegrations/9 took 0.885: duration=884ms exception in middlewares: 
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/uvicorn/protocols/websockets/websockets_impl.py", line 332, in asgi_send
...
  File "/usr/local/lib/python3.12/site-packages/websockets/legacy/protocol.py", li

## Notes

_Add implementation notes, blockers, and context here_

## Related

_Add wikilinks to related people, meetings, or other tickets_