Skip to content

Update cache when file size === 0 - #35353

Merged
artonge merged 1 commit into
masterfrom
artonge/fix/cache_update_when_file_size_equal_0
Nov 23, 2022
Merged

Update cache when file size === 0#35353
artonge merged 1 commit into
masterfrom
artonge/fix/cache_update_when_file_size_equal_0

Conversation

@artonge

@artongeartonge commented Nov 23, 2022

Copy link
Copy Markdown
Collaborator

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.

@artongeartonge self-assigned this Nov 23, 2022
@artongeartonge added this to the Nextcloud 26 milestone Nov 23, 2022
@artonge

Copy link
Copy Markdown
CollaboratorAuthor

/backport to stable25

@artonge

Copy link
Copy Markdown
CollaboratorAuthor

/backport to stable24

@szaimenszaimen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM but didnt test

@PVince81PVince81 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍

@PVince81

Copy link
Copy Markdown
Member

great find!

@PVince81

Copy link
Copy Markdown
Member

/backport to stable23

@PVince81

Copy link
Copy Markdown
Member

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

@PVince81PVince81 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
Copy Markdown
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
artongeforce-pushed the artonge/fix/cache_update_when_file_size_equal_0 branch from fb73ab2 to 66ba90cCompareNovember 23, 2022 11:44
@artonge
artonge enabled auto-merge November 23, 2022 12:56
@artonge
artonge merged commit bbc1f6d into masterNov 23, 2022
@artonge
artonge deleted the artonge/fix/cache_update_when_file_size_equal_0 branch November 23, 2022 14:51
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4. to releaseReady to be released and/or waiting for tests to finishbugfeature: files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@artonge@PVince81@skjnldsv@szaimen