Fix QWebSocket error signal. Fixes #3804

This commit is contained in:
grossmj
2026-03-24 09:16:07 +08:00
parent d56b9660c9
commit 6a033658ef
2 changed files with 8 additions and 2 deletions

View File

@@ -432,7 +432,10 @@ class Controller(QtCore.QObject):
else:
self._notification_stream = self._http_client.connectWebSocket(self._websocket, "/notifications/ws")
self._notification_stream.textMessageReceived.connect(self._websocket_event_received)
self._notification_stream.errorOccurred.connect(self._websocket_error)
if parse_version(QtCore.QT_VERSION_STR) < parse_version("6.5.0"):
self._notification_stream.error.connect(self._websocket_error)
else:
self._notification_stream.errorOccurred.connect(self._websocket_error)
self._notification_stream.sslErrors.connect(self._sslErrorsSlot)
log.info("Listening for controller notifications on '{}'".format(self._notification_stream.requestUrl().toString()))

View File

@@ -642,7 +642,10 @@ class Project(QtCore.QObject):
path = "/projects/{project_id}/notifications/ws".format(project_id=self._id)
self._notification_stream = Controller.instance().httpClient().connectWebSocket(self._websocket, path)
self._notification_stream.textMessageReceived.connect(self._websocket_event_received)
self._notification_stream.errorOccurred.connect(self._websocket_error)
if parse_version(QtCore.QT_VERSION_STR) < parse_version("6.5.0"):
self._notification_stream.error.connect(self._websocket_error)
else:
self._notification_stream.errorOccurred.connect(self._websocket_error)
self._notification_stream.sslErrors.connect(self._sslErrorsSlot)
log.info("Listening for project notifications on '{}'".format(self._notification_stream.requestUrl().toString()))