Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

show '--' for negative file size #1393

Merged
merged 2 commits into from
Jun 21, 2021
Merged

show '--' for negative file size #1393

merged 2 commits into from
Jun 21, 2021

Conversation

individual-it
Copy link
Member

@individual-it individual-it commented Jun 17, 2021

Description

  1. use toEqual to assert content, because toMatch is expecting a regex, to toMatch("") would always be true, I noticed it after I changed the code and the test still passed
  2. as discussed in [QA] show 'pending' when the folder size is not yet computed #1402 show negative number as -- and not empty string

How Has This Been Tested?

unit tests

Types of changes

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation added/updated

Open tasks:

  • ...

@update-docs
Copy link

update-docs bot commented Jun 17, 2021

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

@LukasHirt
Copy link
Collaborator

LukasHirt commented Jun 17, 2021

Isn't a negative value returned if the size is being still calculated?

@individual-it
Copy link
Member Author

How? 'size' should never be negative now

@pascalwengerter
Copy link
Contributor

How? 'size' should never be negative now

I think he (and me as well) were wondering how a server can even return a negative value in the first place ;D

@LukasHirt
Copy link
Collaborator

https://central.owncloud.org/t/understanding-pending-state/6884/3

A folder appears pending if their size is "-1" in oc_filecache. It usually means that its content hasn't been scanned so the folder size is unknown since the contents size itself is also unknown.

@individual-it
Copy link
Member Author

@LukasHirt thank you for the explanation, I actually did not knew that.

@individual-it
Copy link
Member Author

should we show an ? if the filesize is -1?

@LukasHirt
Copy link
Collaborator

should we show an ? if the filesize is -1?

Good question... I think this is how oC classic is handling this case so at least for now I'd say yes, let's do so

@pascalwengerter
Copy link
Contributor

pascalwengerter commented Jun 18, 2021

FYI found this in web: https://github.com/owncloud/web/issues/2131

Not sure if pending or ? are better, we may want to add context for a11y reasons? @kulmann

@pascalwengerter
Copy link
Contributor

FYI found this in web: owncloud/web#2131

Not sure if pending or ? are better, we may want to add context for a11y reasons? @kulmann

Actually transferred this issue to the ODS so this PR will close it 💪🏽

@individual-it individual-it changed the title show '0 B' for negative file size show '--' for negative file size Jun 21, 2021
@individual-it
Copy link
Member Author

I've changed it to be -- as proposed in #1402

@sonarcloud
Copy link

sonarcloud bot commented Jun 21, 2021

Kudos, SonarCloud Quality Gate passed!

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

100.0% 100.0% Coverage
0.0% 0.0% Duplication

Copy link
Contributor

@pascalwengerter pascalwengerter left a comment

Choose a reason for hiding this comment

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

LGTM 💯 love it

Copy link
Member

@kulmann kulmann left a comment

Choose a reason for hiding this comment

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

🚀

@kulmann kulmann merged commit 320b833 into master Jun 21, 2021
@delete-merged-branch delete-merged-branch bot deleted the OcResourceSizeFix branch June 21, 2021 10:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[QA] show 'pending' when the folder size is not yet computed
4 participants