Fix more UME split regressions for sync and alarm WSS.

Restore sql_text and alarm-apply imports, slim WSS handshake headers to accessToken only, and treat 404/503 handshakes as lost subscriptions.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-08-06 15:59:02 +08:00
parent 4054f55988
commit c91d1571a2
4 changed files with 9 additions and 2 deletions

View file

@ -656,10 +656,11 @@ class UMEClient:
def ws_auth_headers(self) -> dict[str, str]:
"""
Headers for WSS handshake — same fields as REST (_headers).
Headers for WSS handshake — accessToken only (no REST content-type).
Does not login/renew; relies on shared token store (token_keepalive / other sync paths).
"""
self._sync_token_from_store()
if not self.has_valid_token():
raise RuntimeError("ume_ws_no_valid_token")
return self._headers(include_token=True)
token = self._token_value.strip()
return {self.auth_header: token}