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

Do not cast sizes to int in Trashbin class #38703

Merged
merged 2 commits into from
Jun 9, 2023

Conversation

come-nc
Copy link
Contributor

@come-nc come-nc commented Jun 8, 2023

This helps with 32bits support

It should fix failing CI: https://github.com/nextcloud/server/actions/workflows/phpunit-32bits.yml

Checklist

This helps with 32bits support

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
@come-nc come-nc added bug feature: 32bits Bug specific to 32bits architectures labels Jun 8, 2023
@come-nc come-nc added this to the Nextcloud 28 milestone Jun 8, 2023
@come-nc come-nc self-assigned this Jun 8, 2023
@come-nc
Copy link
Contributor Author

come-nc commented Jun 8, 2023

/backport to stable27

@come-nc come-nc mentioned this pull request Jun 8, 2023
22 tasks
@come-nc come-nc added the 3. to review Waiting for reviews label Jun 8, 2023
apps/files_trashbin/lib/Trashbin.php Fixed Show resolved Hide resolved
apps/files_trashbin/lib/Trashbin.php Fixed Show fixed Hide fixed
apps/files_trashbin/lib/Trashbin.php Fixed Show fixed Hide fixed
apps/files_trashbin/lib/Trashbin.php Fixed Show fixed Hide fixed
apps/files_trashbin/lib/Trashbin.php Fixed Show fixed Hide fixed
@blizzz blizzz added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Jun 8, 2023
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
@skjnldsv skjnldsv merged commit a719b43 into master Jun 9, 2023
@skjnldsv skjnldsv deleted the fix/trashbin-types-for-32bits branch June 9, 2023 06:33
@skjnldsv
Copy link
Member

skjnldsv commented Jun 9, 2023

#38717

@backportbot-nextcloud
Copy link

The backport to stable27 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable27
git pull origin stable27

# Create the new backport branch
git checkout -b fix/foo-stable27

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts. Resolve them.
git cherry-pick abc123

# Push the cherry pick commit to the remote repository and open a pull request
git push origin fix/foo-stable27

More info at https://docs.nextcloud.com/server/latest/developer_manual/getting_started/development_process.html#manual-backport

@go2sh
Copy link
Contributor

go2sh commented Jun 9, 2023

Are ypu really Sure to allow filesizes to be float? It can only represent 24bit filesizes accurately on 32 bit systems. Every filesize bigger will ge an error, which gets bigger with bigger filesizes. On can argue that for the trashbin size this might be OK, but for concrete files I doubt it.

@come-nc
Copy link
Contributor Author

come-nc commented Jun 12, 2023

Are ypu really Sure to allow filesizes to be float? It can only represent 24bit filesizes accurately on 32 bit systems. Every filesize bigger will ge an error, which gets bigger with bigger filesizes. On can argue that for the trashbin size this might be OK, but for concrete files I doubt it.

This is not a choice, this is how PHP works on 32bits. Any int bigger than what an int can contain is casted into a float. This causes type errors as soon as a file is bigger than 4G, or in this case when empty space in the Trashbin is bigger than 4G, which happens quite often.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release Ready to be released and/or waiting for tests to finish bug feature: 32bits Bug specific to 32bits architectures
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants