feat(connection): TTL-filtered last_known_map snapshot of the per-package cache (P3-3b feed)

This commit is contained in:
James Mackay committed 2026-10-08 10:42:24 +01:00
1 parent bb2f787fcd
commit aa4ee7ed62
1 file changed
+9
@@ -446,6 +446,15 @@ class ShieldConnectionManager:
return None
return info
def last_known_map(self) -> dict[str, MediaSessionInfo]:
"""TTL-filtered snapshot of the per-package last-known cache."""
result: dict[str, MediaSessionInfo] = {}
for package in tuple(self._last_known):
info = self.last_known_session(package)
if info is not None:
result[package] = info
return result
def last_known_state(
self, package: str
) -> tuple[MediaSessionInfo | None, float | None]: