Moved s3 object checker to run before handlefile, to improve active scans UI#4893
Open
jordanTunstill wants to merge 1 commit intomainfrom
Open
Moved s3 object checker to run before handlefile, to improve active scans UI#4893jordanTunstill wants to merge 1 commit intomainfrom
jordanTunstill wants to merge 1 commit intomainfrom
Conversation
mustansir14
requested changes
Apr 17, 2026
Contributor
mustansir14
left a comment
There was a problem hiding this comment.
I'm unsure if this addresses the underlying issue. Discussing this internally.
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.
Description:
moved the atomic.AddUint64(state.objectCount, 1) call to fire before handlers.HandleFile, so objects are counted as "scanned" as soon as GetObject succeeds and they reach the handler -- regardless of whether HandleFile returns an error afterward.
In Enterprise UI, s3 Buckets are returning a message of "Completed Scanning Source: 0 Objects scanned", when there are scanned results present. This will mean that a partial error while not stop scanned objects from being counted.
Checklist:
make test-community)?make lintthis requires golangci-lint)?Note
Low Risk
Small, localized change that only shifts when the scanned-object counter increments; no auth, data mutation, or API contract changes.
Overview
Adjusts S3 scanning progress accounting so an object is counted as “scanned” immediately after a successful
GetObject, beforehandlers.HandleFileruns.This prevents the UI/reporting from showing
0 objects scannedwhenHandleFileerrors occur after retrieval, while keeping existing error logging/metrics behavior unchanged.Reviewed by Cursor Bugbot for commit 09d6f23. Bugbot is set up for automated code reviews on this repo. Configure here.