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

Update cache when file size === 0 #35353

Merged
merged 1 commit into from
Nov 23, 2022

Conversation

artonge
Copy link
Contributor

@artonge artonge commented Nov 23, 2022

The conditions were false when $result === 0.
$results here contains the number of written bits.
The correct way of checking for operation success is to check if $result === false

Question

  • Not sure what $result is supposed to contain for other operation, but it is probably safe to assume that none were returning 0 for saying error

How to test

  1. Create a new plain text file toto.txt
  2. Add a dummy content and wait for it to be saved
  3. Clear the content and wait for it to be savec
  4. Refresh view and constat that file size and mtime is not up to date.

@artonge artonge self-assigned this Nov 23, 2022
@artonge artonge added this to the Nextcloud 26 milestone Nov 23, 2022
@artonge
Copy link
Contributor Author

artonge commented Nov 23, 2022

/backport to stable25

@artonge
Copy link
Contributor Author

artonge commented Nov 23, 2022

/backport to stable24

Copy link
Contributor

@szaimen szaimen left a comment

Choose a reason for hiding this comment

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

LGTM but didnt test

Copy link
Member

@PVince81 PVince81 left a comment

Choose a reason for hiding this comment

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

👍

@PVince81
Copy link
Member

great find!

@PVince81
Copy link
Member

/backport to stable23

@PVince81
Copy link
Member

backporting further because file cache inconsistencies can be nasty with some versions of the desktop client

@PVince81 PVince81 added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Nov 23, 2022
@PVince81
Copy link
Member

@artonge linter not happy though, maybe remove the unrelated formatting changes ?

The conditions were false when $result === 0.
$results here contains the number of written bits.
The correct way of checking for operation success is to check if $result === false

Signed-off-by: Louis Chemineau <louis@chmn.me>
@artonge artonge force-pushed the artonge/fix/cache_update_when_file_size_equal_0 branch from fb73ab2 to 66ba90c Compare November 23, 2022 11:44
@artonge artonge merged commit bbc1f6d into master Nov 23, 2022
@artonge artonge deleted the artonge/fix/cache_update_when_file_size_equal_0 branch November 23, 2022 14:51
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: files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants