[stable27] fix(files): race condition on web files view change#41206
Merged
[stable27] fix(files): race condition on web files view change#41206
Conversation
8 tasks
Contributor
Author
|
/backport to stable26 |
Signed-off-by: Grigorii K. Shartsev <[email protected]>
It is handled by new navigation with Vue Signed-off-by: Grigorii K. Shartsev <[email protected]>
Signed-off-by: Grigorii K. Shartsev <[email protected]>
01b4b30 to
d439417
Compare
skjnldsv
approved these changes
Oct 31, 2023
Member
skjnldsv
left a comment
There was a problem hiding this comment.
Make sense! Nice catch, this legacy router is a pain 🥖
sorbaugh
approved these changes
Oct 31, 2023
Contributor
Author
|
Want to check one more case with page reload when switching from the shared folder to "All files". |
Contributor
Author
|
@skjnldsv Do know any edge cases with legacy navigation/apps here that should be tested? |
Contributor
Author
Unrelated to this issue.
|
Contributor
Author
|
/backport to stable26 |
Merged
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:changedserver/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
changeDirectoryis 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
shownevent 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.shownthat 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
silentmode support for legacy navigation changed. Actually, the same that was there before migration to Vue.Checklist