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
[stable27] fix(files): race condition on web files view change #41206
Conversation
/backport to stable26 |
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
It is handled by new navigation with Vue Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
01b4b30
to
d439417
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sense! Nice catch, this legacy router is a pain 🥖
Want to check one more case with page reload when switching from the shared folder to "All files". |
@skjnldsv Do know any edge cases with legacy navigation/apps here that should be tested? |
Unrelated to this issue.
|
/backport to stable26 |
Summary
A small regression from #35772
This issue does not exist on Nextcloud 28 due to full files to view migration.
How to reproduce
Try several times to reproduce. Then more files in root then more chances to reproduce.
bug.mp4
Root of the issue
There is a race condition.
Opening a shared folder makes 2 actions:
server/apps/files_sharing/js/app.js
Lines 260 to 263 in 6bfbb47
Changing view from "sharingin" to "files" emits
files:legacy-navigation:changed
server/apps/files/js/app.js
Lines 223 to 226 in 6bfbb47
Then the Files view is open on root path
/
which causes fetching the root files list.server/apps/files/src/views/Navigation.vue
Lines 233 to 242 in 6bfbb47
See
this.show
:server/apps/files/src/views/Navigation.vue
Lines 214 to 219 in 2aa15a1
And the handler:
server/apps/files/js/filelist.js
Lines 779 to 788 in 2aa15a1
Here is were the first request is made.
Then the initial
changeDirectory
is called. Which also results in changing directory (to the correct one) and fetching the actual shared directory files list.🏎️ Here is a race. When the root directory is large, its response may come later so root files are shown instead of the shared folder.
Changing view also triggers a
shown
event that sets the current directory to/
and reloads content. It causes duplicated file requests.server/apps/files/js/filelist.js
Lines 765 to 774 in 2aa15a1
Before Vue migration, there was a check for
this.shown
that avoided this behavior.server/apps/files/js/filelist.js
Lines 761 to 773 in f720d6e
If I'm not wrong, with migrating navigation to Vue, we can just remove this part. cc @skjnldsv
TODO
silent
mode support for legacy navigation changed. Actually, the same that was there before migration to Vue.Checklist