Skip to content

File-by-file: Mark metadata files as loaded when the full file is stored

Thomas Randolph requested to merge tor/feature/fbf-mark-tree-files into master

What does this MR do and why?

When a full diff file is loaded, these changes also mark the corresponding file in the authoritative list as having been loaded.

Why

Context

For #337263 (closed).

We are making File-by-file view mode much more useful by only fetching the single file that you are trying to view at any time.

In extreme cases, if the file you are viewing is the last in a long list (say 100s or 1000s of files), batch-loading the diffs could introduce an extremely noticeable delay before your single file is loaded and displays while the app loads tons of files you have no interest in.

The above issue - and this chain of MRs - will resolve that problem by loading only the file needed to display.

Specifics

We need a way to avoid constantly reloading the same file, so the first time it's loaded, we flip this flag.

In file-by-file mode, you could easily flip back and forth to a file, and it should load from memory every time after the first.

We'll also need the old/new paths to load files in the future, so we store those, too.

Roadmap

This MR is one of a set of changes that will eventually implement this feature.

Status MR Purpose
🚀 Merged !112515 (merged) Adds the API access we need for the more surgical data
🚀 Merged !112516 (merged) Switches to using our initial metadata representation of the MR for many operations
We are here! 👉🏻 !113941 (merged) Marks metadata files as loaded so future uses don't try to load them again
🚀 Merged !113940 (merged) Adds helpers to re-retrieve the hash from the URL since it only needed to be fetched once before
🛠 In Dev !113937 (merged) Adds an action to fetch and store a single file versus the existing full diff batch loading
🛠 In Dev !114009 (merged) Add a getter to check the files marked in !113941 (merged) to simplify "already-loaded" guard clauses
🛠 In Dev !114024 (merged) Add an action to scroll to a file async (and load it if necessary)
🛠 In Dev !114170 (merged) Adds an action to re-check the note hash from the URL and potentially fetch the appropriate file
🛠 In Dev !111895 (merged) Adds the feature that will only load the proper file when necessary to display it

Screenshots or screen recordings

N/A, all backstage

How to set up and validate locally

There isn't much to validate here, since the new data is stored but not used.

The best way to confirm it might be to inspect the Vuex store data.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Thomas Randolph

Merge request reports