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.
Description
problem statement:
our
files
array in the vuex store of the files app is only capable of representing one state.multiple PROPFINDs for different folders, fired at similar times, will override each other in that state.
the longest running propfind wins. Cancelling the requests is not solving all edge cases, as the
PROPFINDs might finish at similar times so that we're in postprocessing of the data and request cancellation is not possible anymore (because request already done).
idea for a solution:
loading resources in the different views should be converted into a two step process, each:
SET_ACTIVE_VIEW
,SET_ACTIVE_PATH
)folder
store module.That store module needs to get registered dynamically. The PROPFIND and conversion might be long running.
It's really important that the activePath is set as early as possible!
the views then render the files of the store module that matches the current
activePath
.as a bonus, requests could be cancelled and data loading method invocations stopped, so that we avoid unnecessary store module creation / data transformation / loading of additional data (e.g. if we know that the response of a PROPFIND is not needed anymore, because the user navigated away from the current location, we could skip loading indicators and previews entirely).
reasons for dynamically registered store modules: we need the reactivity of the individual files.
Which comes built in with the store modules. Another approach would be to build a cache of recent
propfind results (= response converted into a file listing). but that's not reactive by default.
Related Issue
Motivation and Context
Reduce glitchiness of the different resource listing views and their respective navigation.
How Has This Been Tested?
Types of changes
Checklist:
Open tasks:
loadResources
methods from the views should live in a service, which then also takes care of creating the respective store module.