Repository navigation
fix: record shutdown interruptions and keep scan cancellation requests - #1241
Merged
Merged
Conversation
- A scan that stops because EdgeWatch stopped is recorded as canceled with "scan interrupted because EdgeWatch stopped" and a scan-interrupted activity event that is never delivered, instead of a scan-canceled alert to every destination. Resumable attempts keep their saved progress and say so. - Active scans report cancel_requested once someone asks to cancel, so the job page and Overview keep showing Cancellation requested while the scanner reports its last progress and the result is saved. - A cancel request after finalization has begun is refused with 409 scan_finalizing, because it could no longer change the outcome. - model.Fingerprint sorts a copy of the CPEs instead of the caller's slice. Fixes #1227, #1228, #1237
Deploying edgewatch with
|
| Latest commit: |
67f0788
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://e5968c1b.edgewatch-cpd.pages.dev |
| Branch Preview URL: | https://fix-scan-cancellation-causes.edgewatch-cpd.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Restarts no longer look like cancellations (#1227)
canceledstatus. Its error now reads "scan interrupted because EdgeWatch stopped"; a resumable attempt adds "; progress was saved".scan-interruptedevent. Activity shows it as Scan interrupted, and it is never queued for notification destinations (model.EventDelivered, checked inqueueEventsTx). A restart therefore no longer sends one "Scan canceled" alert per destination. The job-silence alert still reports a daemon that keeps stopping.Cancellation state survives progress updates (#1228)
cancel_requested: trueonce a cancel is requested.phasekeeps following the scanner, which reports one last progress update when its process stops, sofinalizingstays visible.POST /scans/{id}/cancelreturns 409scan_finalizing, because cancelling could no longer change the result.model.Fingerprint(#1237)acceptedServiceForEvidenceis no longer needed and has been removed. The fingerprint values are unchanged.Compatibility
cancel_requestedon active scans;scan-interruptedevent type in Activity and the live stream;scan_finalizingfrom the cancel route.scan-cancelednotification.TestManagedTerminalOutcomesQueueNotifications).Validation
gofmt,go vet ./...go test -raceforinternal/app,internal/engine,internal/modelandinternal/web, plus the outbox, runtime and incident tests ininternal/store.npm run lintmain, Activity, Dashboard and JobDetail.npm --prefix docs run buildNew tests:
internal/app/scan_interruption_test.go:scan-interrupted, writes it to Activity, and queues nothing in the outbox;cancel_requestedsurvives a progress update;ErrScanFinalizing;EventDelivered, andFingerprintleaves the caller's slice unchanged.scanningorfinalizing; Activity labels the event; the stream invalidates for it.Docs: the notifications guide covers interrupted scans, and the scanning guide covers the cancel flow.
Fixes #1227
Fixes #1228
Fixes #1237