feat(update): integrate managed installs and recoverable in-app updates (#6168)
Add owner-aware Stable and Preview updates with explicit consent, verified release plans, protected process handoff and bounded service recovery. Keep configuration and conversations separate from program rollback. Include the compact About controls, Windows long-path support, native package recovery checks and optional macOS Dock lifecycle integration. Preserve documented guidance for installations owned by other managers. This code integration does not publish packages, enable signing or advance the public update channel. Co-authored-by: chengyongru <61816729+chengyongru@users.noreply.github.com>
This commit is contained in:
1 parent
76da55994b
commit
fbb61a373f
216 files changed
+27948
-1084
No files matched your search
@@ -46,6 +46,20 @@ class FeishuConnectStore:
|
||||
self._sessions: dict[str, FeishuConnectSession] = {}
|
||||
self._completion_lock = threading.Lock()
|
||||
|
||||
@property
|
||||
def has_pending_work(self) -> bool:
|
||||
# Registration only advances inside an owned settings request. Expired
|
||||
# QR records have no listener or detached writer to keep alive.
|
||||
now = time.monotonic()
|
||||
return any(session.deadline > now for session in tuple(self._sessions.values()))
|
||||
|
||||
async def close(self) -> None:
|
||||
def clear() -> None:
|
||||
with self._completion_lock:
|
||||
self._sessions.clear()
|
||||
|
||||
await asyncio.to_thread(clear)
|
||||
|
||||
async def handle(self, action: str, query: QueryParams) -> dict[str, Any]:
|
||||
"""Handle one generic settings connection action."""
|
||||
if action == "start":
|
||||
|
||||
@@ -11,8 +11,10 @@ from nanobot.channels.feishu.connect import FeishuConnectStore
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@pytest.mark.parametrize("shutdown", [False, True])
|
||||
async def test_feishu_cancel_wins_over_inflight_confirmation(
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
shutdown: bool,
|
||||
) -> None:
|
||||
poll_started = threading.Event()
|
||||
release_poll = threading.Event()
|
||||
@@ -52,15 +54,20 @@ async def test_feishu_cancel_wins_over_inflight_confirmation(
|
||||
|
||||
store = FeishuConnectStore()
|
||||
started = await store.handle("start", {})
|
||||
assert store.has_pending_work is True
|
||||
query = {"session_id": [started["session_id"]]}
|
||||
poll_task = asyncio.create_task(store.handle("poll", query))
|
||||
assert await asyncio.to_thread(poll_started.wait, 5)
|
||||
|
||||
cancelled = await store.handle("cancel", query)
|
||||
if shutdown:
|
||||
await store.close()
|
||||
else:
|
||||
cancelled = await store.handle("cancel", query)
|
||||
assert cancelled["status"] == "cancelled"
|
||||
release_poll.set()
|
||||
completed = await poll_task
|
||||
|
||||
assert cancelled["status"] == "cancelled"
|
||||
assert store.has_pending_work is False
|
||||
assert completed["status"] == "cancelled"
|
||||
assert saved_results == []
|
||||
|
||||
|
||||
Reference in new issue
Block a user