Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 16 additions & 8 deletions ovos_utils/fakebus.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,14 @@
try: # replicate side effects
from ovos_bus_client.session import Session, SessionManager
sess = Session.from_message(parsed_message)
# every session — including the default id — folds onto the singleton
# (value-passing; nothing is owner-only, matching the spec-tools
# SessionManager and the real MessageBusClient)
SessionManager.update(sess)
if sess.session_id != "default":
# 'default' can only be updated by core — matching the real
# MessageBusClient.on_message, which never folds the default
# session on receive (only the explicit ovos.session.update_default
# broadcast updates it). Folding a stale token-less default
# snapshot back over the singleton would wipe in-place
# add_context mutations (e.g. intent-layer gating tokens).
SessionManager.update(sess)
except ImportError:
pass # don't care

Expand Down Expand Up @@ -274,7 +278,7 @@
# dependency, the canonical class is always present, and
# ``ovos-bus-client.Message`` is the **same** class (bus-client attaches
# ``publish`` to it too — both attachments are idempotent).
from typing import Any, Dict, Optional

Check failure on line 281 in ovos_utils/fakebus.py

View workflow job for this annotation

GitHub Actions / lint / lint

ruff (E402)

ovos_utils/fakebus.py:281:1: E402 Module level import not at top of file

from ovos_spec_tools.message import Message as FakeMessage
from ovos_utils.log import deprecated
Expand Down Expand Up @@ -499,10 +503,14 @@
try: # replicate side effects
from ovos_bus_client.session import Session, SessionManager
sess = Session.from_message(parsed_message)
# every session — including the default id — folds onto the singleton
# (value-passing; nothing is owner-only, matching the spec-tools
# SessionManager and the real MessageBusClient)
SessionManager.update(sess)
if sess.session_id != "default":
# 'default' can only be updated by core — matching the real
# MessageBusClient.on_message, which never folds the default
# session on receive (only the explicit ovos.session.update_default
# broadcast updates it). Folding a stale token-less default
# snapshot back over the singleton would wipe in-place
# add_context mutations (e.g. intent-layer gating tokens).
SessionManager.update(sess)
except ImportError:
pass # don't care

Expand Down
Loading