Skip to content

Moved s3 object checker to run before handlefile, to improve active scans UI#4893

Open
jordanTunstill wants to merge 1 commit intomainfrom
S3BucketCounter
Open

Moved s3 object checker to run before handlefile, to improve active scans UI#4893
jordanTunstill wants to merge 1 commit intomainfrom
S3BucketCounter

Conversation

@jordanTunstill
Copy link
Copy Markdown
Contributor

@jordanTunstill jordanTunstill commented Apr 16, 2026

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:

  • Tests passing (make test-community)?
  • Lint passing (make lint this 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, before handlers.HandleFile runs.

This prevents the UI/reporting from showing 0 objects scanned when HandleFile errors 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.

@jordanTunstill jordanTunstill requested a review from a team April 16, 2026 23:01
@jordanTunstill jordanTunstill requested a review from a team as a code owner April 16, 2026 23:01
Copy link
Copy Markdown
Contributor

@mustansir14 mustansir14 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm unsure if this addresses the underlying issue. Discussing this internally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants