Skip to content

fix(files): fetch directory content on nested files update#60527

Open
Antreesy wants to merge 2 commits into
masterfrom
fix/99286/reactive-file-size
Open

fix(files): fetch directory content on nested files update#60527
Antreesy wants to merge 2 commits into
masterfrom
fix/99286/reactive-file-size

Conversation

@Antreesy
Copy link
Copy Markdown
Contributor

@Antreesy Antreesy commented May 19, 2026

  • Resolves: file size update after editing
  • Requires external app to support global Nextcloud events, particularly emit('files:node:updated', node)
    • e.g. Text app should have it

Summary

Reproduction steps:

  • Create a .txt file in a folder
  • Insert /type a content in it via Text editor
  • Wait for app to sync/save the file
  • Close editor
  • See the correct file size (not 0)
Before After
image image

TODO

  • Test coverage?
  • Perf implications?

Checklist

AI (if applicable)

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

Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
@Antreesy Antreesy added this to the Nextcloud 35 milestone May 19, 2026
@Antreesy Antreesy self-assigned this May 19, 2026
@Antreesy
Copy link
Copy Markdown
Contributor Author

/compile

Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
@Antreesy Antreesy requested review from CarlSchwan and susnux May 20, 2026 09:04
@Antreesy Antreesy marked this pull request as ready for review May 20, 2026 09:04
@Antreesy Antreesy requested review from a team and skjnldsv as code owners May 20, 2026 09:04
@Antreesy Antreesy requested review from nfebe and removed request for a team May 20, 2026 09:04
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.

This should be handled by the files store not the files list.
The files list should only fetch content when the current folder is changed.

Copy link
Copy Markdown
Contributor

@susnux susnux left a comment

Choose a reason for hiding this comment

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

Node updates are handled in the files store, the list only handles updates of the current folder to refetch it because changes on folders often mean that all child nodes are invalidated.

But files are handled in the store, moreover the idea in the files app is to not fetch updates from server, this often causes performance problems because apps might change many nodes at once. Instead the files:node:updated event is for submitting your changes to a node locally so that no server requests are needed.

Meaning the real problem here is that the text app does only update the mtime but not the size when submitting the updated node:

https://github.com/nextcloud/text/blob/34a7c9a4920732d1d611741a59295088557b5ace/src/components/Editor.vue#L736-L737

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants