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

don't include versions in quota check #2863

Merged
merged 1 commit into from
May 13, 2022
Merged

Conversation

C0rby
Copy link
Contributor

@C0rby C0rby commented May 12, 2022

Fixed the quota check to not count the quota of previous versions.

This will fix the situation where the quota is exceeded and the user wants to create a new version of an existing file.
See this issue for more information: owncloud/ocis#2829

@C0rby C0rby self-assigned this May 12, 2022
@C0rby C0rby requested review from a team, labkode, ishank011 and glpatcern as code owners May 12, 2022 14:42
@C0rby C0rby force-pushed the versions-quota branch 2 times, most recently from 977ce4e to 372bfe7 Compare May 12, 2022 14:59
Copy link
Contributor

@dragotin dragotin left a comment

Choose a reason for hiding this comment

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

LGTM. Nice code style :)

if quotaByte == "" {
// if quota is not set, it means unlimited
return true, nil
}
total, _ = strconv.ParseUint(quotaByte, 10, 64)
total, _ := strconv.ParseUint(quotaByte, 10, 64)
Copy link
Contributor

Choose a reason for hiding this comment

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

When reading the code, I found total a bit of a missleading name. Maybe change to quotaByte and the String of quotaByte to quotaByteStr ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

@C0rby C0rby force-pushed the versions-quota branch from 372bfe7 to b166a90 Compare May 13, 2022 07:48
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

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