-
Notifications
You must be signed in to change notification settings - Fork 168
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
fix(view rendering): cancel overlapping resource requests #5917
Conversation
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.
😍😍😍
Linter is not happy. ;-) Tested it locally and wasn't able to break it. 🚀 |
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.
I think you forgot the PublicFiles
and LocationPicker
views.
introduce iterable generators using vue-concurrency to cancel resource request that no longer needed. Fixes wrong view rendering for long running requests
c01974c
to
b24fab0
Compare
SonarCloud Quality Gate failed. |
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.
❤️
Description
While testing the files app with heavy load we've found some cases where it could happen that the ui breaks or displays wrong list of files, this only happened when navigation fast between the different views.
To dig a bit deeper we've used the mounted and created hooks to load current views resources for files app, which can lead to overlapping rendering when view
A
still prepares the resource data and the user quickly switches to viewB
. If thenB
is rendered beforeA
is finished vue renders the viewA
intoB
.This is an overall problem and is present in many projects, where state, data and timing overlaps. This potentially is a memory leak also, in cases where
this
is used and the instance isn't around anymore.This PR fixes those cases for the files app by superseding the usual vue behavior and use iterable generators from vue-concurrency and cancel the preparation step (request loading, state loading, view rendering) when not needed anymore.
Related Issue
Motivation and Context
get a fast and concurrency safe ui
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist:
Open tasks: