Removed cast to integer in getSize#5744
Conversation
Fixes - Wrong or no sizes of files/folders nextcloud#5031
|
@1manprojects, thanks for your PR! By analyzing the history of the files in this pull request, we identified @icewind1991, @nickvergessen and @DeepDiver1975 to be potential reviewers. |
|
Works ! Please consider for 12.0.1 @MorrisJobke |
|
Was added in #4001 🙈 |
icewind1991
left a comment
There was a problem hiding this comment.
If this is causing problems on 32bit systems it should be changed to 0 + instead of just removing it
|
How would a change to 0+ help in this situation. PHP will automacily change a integer value on overflow to a float unless it is casted. Casting the filesize directly to int would always couse problems on certain files if they are large enough. |
|
doing a |
Codecov Report
@@ Coverage Diff @@
## master #5744 +/- ##
============================================
- Coverage 53.86% 53.85% -0.01%
Complexity 22755 22755
============================================
Files 1405 1405
Lines 86711 86711
Branches 1328 1328
============================================
- Hits 46705 46699 -6
- Misses 40006 40012 +6
|
|
Thanks for the info , @icewind1991. I changed the commit so it will be cast to a numeric value with 0 +. |
|
@1manprojects Could I ask you to open another PR against stable12 for the backport? Thanks |
|
And congratulations to your first contribution to Nextcloud 🎉 |
|
Please backport to 12.0.1. Why is this 32bit only? As I know I have a Debian 9 with 64bit and see the issue. |
|
Well technically this could also affect 64-bit system if a foldersize of filesize is large then the 64-bit integer range however this is a very large number. |
|
I can only say that I have e.g 550 files of 10-20mb each in a folder and the sum counter on upper folder overview is zero. There is no file thst is 2gb or larger in the folder. All files have just max 25mb. In a sum it is nearly 7.2gb in these folders. I also have orher folders with smaller files and less mb and they are also 0mb in nextcloud web interface. I hope i do not need to wait until 13.0 to see this issue resolved. |
|
It must be a different issue then, you would need billions of files of that size to reach the 64 Bit, today, this is impossible. Are you sure that you have a 64 Bit Php installation? |
|
Not sure... how can I find out? The OS is 64bit... Debian 9. I suspect every package is x64 that is embedded, but I could be wrong. Let me know how to find out, please.
|
|
Just run: If the result is |
|
Ok, 64bit php as expected... should I debug something on DB level to help you identify the root cause of the 0 counters? I have made a brand new install with 12.0. No upgrade... I'm have only 1 week expierence with nextcloud itself. |
|
I tested |
|
Good. Now you've done several tests. I think if there is a problem then it is not related to this change. Http2 is unrelated, as you expect, and the files scan is not needed to be run within cron. I'd ask you to open a new ticket and attach a detailed log, if that is possible. Maybe we can find the root cause that way. |
Fixes - Wrong or no sizes of files/folders nextcloud#5031 for 32-bit systems a direct cast to integer causes problems. Backport from nextcloud#5744 Signed-off-by: Sebastian Kostka <sebastian.kostka@gmail.com>
|
Created a PR (#5925) for 12.0.1, please review. Thanks ! |
Fixes - Wrong or no sizes of files/folders #5031 for 32-bit systems a direct cast to integer causes problems.