Skip to content

Conversation

@kesselb
Copy link
Contributor

@kesselb kesselb commented Feb 14, 2019

Follow-Up #11518

  • file1.txt
  • folder/file1.txt

If a file with the same name exists in a sub directory (prefix to be precise) file1.txt is overwritten (the array key not the file itself) by folder/file1.txt. getContentLength and getLastModified are called with folder/file1.txt and the internal cache does not hit.

@kesselb kesselb added enhancement 3. to review Waiting for reviews labels Feb 14, 2019
@kesselb kesselb added this to the Nextcloud 16 milestone Feb 14, 2019

try {
if ($this->headObject($path)) {
if (isset($this->filesCache[$path]) && $this->headObject($path)) {
Copy link
Member

Choose a reason for hiding this comment

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

what is the reasoning here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If filesCache has been populated by opendir we already know that path is a file or not without calling headObject. If you wonder about "only call headObject if $path isset in filescache" 0d667d1

Copy link
Member

@MorrisJobke MorrisJobke left a comment

Choose a reason for hiding this comment

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

Code makes sense 👍

@MorrisJobke MorrisJobke merged commit 7fc68fe into master Feb 19, 2019
@MorrisJobke MorrisJobke deleted the bugfix/prefix-path-to-filecache-s3 branch February 19, 2019 11:01
@MorrisJobke
Copy link
Member

@kesselb @icewind1991 Backport to stable15?

@kesselb
Copy link
Contributor Author

kesselb commented Feb 19, 2019

/backport to stable15

@backportbot-nextcloud
Copy link

backport to stable15 in #14288

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants