Skip to content

Remove type hint for AbstractTrash.getSize() - #17609

Closed
scriptator wants to merge 2 commits into
nextcloud:masterfrom
scriptator:scriptator-fix-trash-32bit
Closed

Remove type hint for AbstractTrash.getSize()#17609
scriptator wants to merge 2 commits into
nextcloud:masterfrom
scriptator:scriptator-fix-trash-32bit

Conversation

@scriptator

Copy link
Copy Markdown

Int is not large enough on 32 bit systems to represent the size of a large trash. This leads to errors when displaying the trash in the web.

See #13160

int is not large enough on 32 bit systems
see nextcloud#13160
Comment threadapps/files_trashbin/lib/Sabre/AbstractTrash.php Outdated
@kesselbkesselb added 3. to review Waiting for reviews bug labels Oct 20, 2019
@kesselbkesselb added this to the Nextcloud 18 milestone Oct 20, 2019
@kesselb

Copy link
Copy Markdown
Contributor

As reference: #16636

@go2sh

Copy link
Copy Markdown
Contributor

The Problem with float is, that the Size loses its precision with a float type. The file size should never be represented by a float. I think the point where the float gets set should be fixed.

As far as I understand the problem 32bit systems are limited to 4G file size.

@scriptator

Copy link
Copy Markdown
Author

As far as I understand the problem 32bit systems are limited to 4G file size.

I don't know, but in this case a file size limit is irrelevant. The size of the trash is the sum of sizes of all files inside. That can easily exceed the 32 bit MAX int regardless of whether there is a size limit for individual files.

This was referenced Dec 11, 2019
@rullzerrullzer mentioned this pull request Dec 19, 2019
18 tasks
@go2sh

Copy link
Copy Markdown
Contributor

This seems to be the same problem as with the zipresponse. I might be a general problem to handle the integer overflow conversion to float.

This was referenced Dec 27, 2019
@rullzerrullzer modified the milestones: Nextcloud 18, Nextcloud 19Jan 7, 2020
This was referenced Apr 4, 2020
This was referenced Apr 15, 2020
@rullzerrullzer mentioned this pull request Apr 23, 2020
11 tasks
@rullzerrullzer removed this from the Nextcloud 19 milestone Apr 24, 2020
@J0WI

J0WI commented Apr 28, 2021

Copy link
Copy Markdown
Contributor

See also #24137

@J0WIJ0WI added the php Pull requests that update Php code label Apr 28, 2021
@kesselb

Copy link
Copy Markdown
Contributor

Thanks for sending a pull request 👍

I'm closing this pull request due inactivity.

@kesselbkesselb closed this Apr 28, 2021
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to reviewWaiting for reviewsbugphpPull requests that update Php code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@scriptator@kesselb@go2sh@J0WI@rullzer