From 03877e97d1a79c1a48771cee528f9889bb8f39b8 Mon Sep 17 00:00:00 2001 From: Cameron Pfiffer Date: Tue, 3 Mar 2026 14:51:48 -0800 Subject: [PATCH] fix: automatically clear outbox after successful dispatch to prevent stale state --- src/void_tools/cli.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/void_tools/cli.py b/src/void_tools/cli.py index a5460f2..e8c1bb1 100644 --- a/src/void_tools/cli.py +++ b/src/void_tools/cli.py @@ -192,6 +192,13 @@ def cmd_dispatch(args): print("Marked notifications as seen.") except Exception as e: print(f"Error marking seen: {e}") + + # Always delete the outbox file after successful dispatch to prevent stale state loops + try: + os.remove(args.file) + print(f"Cleared {args.file} to prevent state desynchronization.") + except Exception as e: + print(f"Failed to clear outbox file: {e}") def cmd_notifications(args): client = get_client() -- 2.51.2