Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Scandata to upload session #4657

Merged
merged 1 commit into from
Apr 25, 2024

Conversation

kobergj
Copy link
Contributor

@kobergj kobergj commented Apr 24, 2024

Adds virus scan data to upload sessions

@kobergj kobergj requested review from a team, labkode and glpatcern as code owners April 24, 2024 09:39
Signed-off-by: jkoberg <jkoberg@owncloud.com>
@kobergj kobergj force-pushed the AddScanResultsToUploadsession branch from 9aeec86 to b9d7022 Compare April 24, 2024 09:39
@@ -298,7 +298,8 @@ func (s *OcisSession) MTime() time.Time {

// IsProcessing returns true if all bytes have been received. The session then has entered postprocessing state.
func (s *OcisSession) IsProcessing() bool {
return s.info.Size == s.info.Offset
// We might need a more sophisticated way to determine processing status soon
return s.info.Size == s.info.Offset && s.info.MetaData["scanResult"] == ""
Copy link
Contributor

Choose a reason for hiding this comment

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

when bytes are ready this will also return true because the scanResult has not been written yet. We should populate it when all bytes have been received. Maybe with "processing"?

Copy link
Contributor Author

@kobergj kobergj Apr 24, 2024

Choose a reason for hiding this comment

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

when bytes are ready this will also return true because the scanResult has not been written yet.

This is what it is supposed to do. It should only return false when a virus was detected. But you are right, there is small time gap in which either

  • virusscan data was written but postprocessing is not yet finished
  • postprocessing is finished but virusscan data is not yet written

I'd consider that "eventual consistent", as this time frame should be very small.

Maybe with "processing"

I don't see how this would change the outcome? Instead of checking for "" we would check for "processing". Nothing else changes.

In general I would consider an item "processing" from the moment all bytes are received until either the upload session gets the deleted (success case) or a virus occurs (error case)

Copy link
Contributor

Choose a reason for hiding this comment

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

got it, I had the logic flipped in my head.

@butonic butonic merged commit 4bb1bbd into cs3org:edge Apr 25, 2024
9 checks passed
@kobergj kobergj deleted the AddScanResultsToUploadsession branch April 25, 2024 10:07
@micbar micbar mentioned this pull request Jun 19, 2024
24 tasks
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.

None yet

3 participants