Make Stop stop: no replay, no restart, immediate feedback
Build — Windows, Linux & macOS / GDPRScanner / linux (push) Has been cancelled
Build — Windows, Linux & macOS / GDPRScanner / macos (push) Has been cancelled
Build — Windows, Linux & macOS / GDPRScanner / windows (push) Has been cancelled
Build — Windows, Linux & macOS / Create GitHub Release (push) Has been cancelled
Build — Windows, Linux & macOS / GDPRScanner / linux (push) Has been cancelled
Build — Windows, Linux & macOS / GDPRScanner / macos (push) Has been cancelled
Build — Windows, Linux & macOS / GDPRScanner / windows (push) Has been cancelled
Build — Windows, Linux & macOS / Create GitHub Release (push) Has been cancelled
Pressing Stop could look like the scan restarting, and for scheduled jobs it really did restart the Google stage. - Scheduler: check the abort flag between stages and never clear the Google abort after a Stop (that started a fresh all-users Google scan). A stopped job is recorded as "cancelled" and skips email/retention; scheduler_done carries cancelled=true. - SSE: scan_cancelled and file_scan_done now end the current scan like scan_done, and sse.replay_messages() never replays a finished scan. Previously a stopped M365 scan (and every file scan) stayed "current", so each reconnect replayed it and re-showed Stop + progress. - Frontend: scan_cancelled clears the M365 running flag and only tears down the UI when no Google/file scan is still running; scheduler_done / scheduler_error clear all running flags. - run_scan: Stop during collection now ends the scan (checkpoint, finish, scan_cancelled) instead of announcing scan_start / "Scanning…". - Stop button: switches to a disabled "Stopping…" state on click; all show/hide goes through _setStopBtnDisplay(), which resets it when hidden or when a new scan starts. Adds tests/test_stop_scan.py (10 tests). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit was merged in pull request #2.
This commit is contained in:
1 parent
9cf23da907
commit
606d8e944b
12 files changed
+372
-64
No files matched your search
+3
-10
@@ -1527,16 +1527,9 @@ def local_ip():
|
||||
def scan_stream():
|
||||
q = queue.Queue(maxsize=512)
|
||||
_sse_queues.append(q)
|
||||
# Filter replay buffer: only include events from the current scan
|
||||
# (avoids replaying stale events from a previous scan)
|
||||
replay_scan_id = _sse_mod._current_scan_id
|
||||
buf = []
|
||||
if replay_scan_id:
|
||||
for msg in list(_sse_buffer):
|
||||
if f'"scan_id": "{replay_scan_id}"' in msg:
|
||||
buf.append(msg)
|
||||
else:
|
||||
buf = list(_sse_buffer)
|
||||
# Replay only the running scan's events, never those of a finished or
|
||||
# stopped scan (see sse.replay_messages)
|
||||
buf = _sse_mod.replay_messages()
|
||||
def generate():
|
||||
try:
|
||||
yield ": connected\n\n"
|
||||
|
||||
Reference in new issue
Block a user