Skip to content
This repository was archived by the owner on Dec 5, 2025. It is now read-only.

Commit 38fc5c4

Browse files
committed
[client] Handle reset state in UI for stream connectors
1 parent 620c5b7 commit 38fc5c4

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

pycti/connector/opencti_connector_helper.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,11 +413,20 @@ def run(self) -> None: # pylint: disable=too-many-branches
413413
pass
414414
if msg.event == "heartbeat" or msg.event == "connected":
415415
state = self.helper.get_state()
416-
state["start_from"] = str(msg.id)
417-
self.helper.set_state(state)
416+
# state can be None if reset from the UI
417+
# In this case, default parameters will be used but SSE Client needs to be restarted
418+
if state is None:
419+
self.exit = True
420+
else:
421+
state["start_from"] = str(msg.id)
422+
self.helper.set_state(state)
418423
else:
419424
self.callback(msg)
420425
state = self.helper.get_state()
426+
# state can be None if reset from the UI
427+
# In this case, default parameters will be used but SSE Client needs to be restarted
428+
if state is None:
429+
self.exit = True
421430
state["start_from"] = str(msg.id)
422431
self.helper.set_state(state)
423432
except:

0 commit comments

Comments
 (0)