Skip to content

fix(files): update cached mounts when their storage changes - #66184

Draft
ArtificialOwl wants to merge 1 commit into
masterfrom
fix/mount-cache-storage-id-change
Draft

ArtificialOwl wants to merge 1 commit into
masterfrom
fix/mount-cache-storage-id-change

Conversation

@ArtificialOwl

Copy link
Copy Markdown
Member
  • Alice creates a local folder,
  • Alice creates a markdown document inside local folder,
  • Alice shares the markdown document to a local Bob,
  • Bob open the files in Nextcloud Text and close it
  • admin creates a groupfolder and give Alice access to it,
  • Alice move the local folder into groupfolder,
  • Bob open the files in Nextcloud Text and get a File not found message

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
Assisted-by: ClaudeCode:claude-opus-5-5

@provokateurin provokateurin 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.

Shouldn't the storage id for Bob not change, because he only sees the file through the SharedStorage?

if (
$newMount->getMountId() !== $cachedMount->getMountId()
|| $newMount->getMountProvider() !== $cachedMount->getMountProvider()
|| $newMount->getStorageId() !== $cachedMount->getStorageId()

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.

The use of findChangedMounts doesn't expect the storage id for a mount to change, so there will be problems.

@ArtificialOwl

Copy link
Copy Markdown
Member Author

Shouldn't the storage id for Bob not change, because he only sees the file through the SharedStorage?

The file is not on the previous storage id anymore; while moving from home::alice to the groupfolders, the storage id in filecache changed but the cached mount keep the previous storage id.
Bob can still see the file when browsing the folder and can still download the file as webdav will not use the cached mount; but opening the document uses the cached mount which still have the wrong storage id.

Maybe a better fix would be to catch the wrongly cached mount and try to fix the cache ?

@ArtificialOwl

Copy link
Copy Markdown
Member Author

I will ping Robin regarding #59900 when he's back

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants