Skip to content
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

Integrate folder caching into web-app #388

Merged
merged 7 commits into from
May 7, 2024

Conversation

meisekimiu
Copy link
Member

@meisekimiu meisekimiu commented Apr 23, 2024

This PR actually integrates the previously hidden PermanentFilesystem class into the application. This is done by creating the PermanentFilesystemService, a wrapper service that allows this functionality to be imported into other modules across the application. The service also provides the proper implementation of the FilesystemApi interface, which wraps around the ApiService and processes the FolderResponse automatically.

Steps to test:

  1. Open the web-app and make sure you have multiple folders with their own contents
  2. Navigate into each folder once
  3. Without refreshing, open the developer console and enable network throttling
  4. Navigate into the folders you went into before. They should load immediately from the folder cache even if the navigateLean response has not finished.
  5. You should not notice any extraneous navigate API calls, or large shifts in UI after the API calls finish.
  6. Make sure that public / shared folders still work as expected as well

@meisekimiu
Copy link
Member Author

Random note about some code changes. I opened #385 pretty recently, but I actually ended up using lodash here since it was available and I wanted to check deep equality between FolderVOs to prevent rerenders. So maybe we should just close that issue for now?

@meisekimiu meisekimiu requested a review from k8lyn6 April 26, 2024 17:30
@meisekimiu meisekimiu force-pushed the folder-caching-implementation branch 3 times, most recently from 3afed8e to bdb3e70 Compare May 2, 2024 13:59
@meisekimiu meisekimiu changed the base branch from main to upload-sourcemaps-fix May 2, 2024 14:01
@meisekimiu meisekimiu changed the base branch from upload-sourcemaps-fix to main May 2, 2024 14:07
@meisekimiu meisekimiu force-pushed the folder-caching-implementation branch from bdb3e70 to bfe2ab6 Compare May 2, 2024 14:20
Wrap the PermanentFilesystem in a new service so that it can be used
throughout the application. Then use it throughtout the application
where we are fetching folders.

PER-9468: Integrate filesystem caching system (folder navigate)
The FileListComponent would refresh the folder contents after it was
initialize. This is not necessary since it is handled by the
PermanentFilesystem now.

PER-9468: Integrate filesystem caching system (folder navigate)
A flash of unloaded thumbnails would sometimes be visible when
navigating to folders since the behind-the-scenes cache update would end
up triggering a rerender of the file list. Prevent this by only
triggering an update to these values when the fetched folder differs
from the cached value.

PER-9468: Integrate filesystem caching system (folder navigate)
This file doesn't have the prettier format pragma on it. Also it has
some unused imports. Get rid of them too.

PER-9468: Integrate filesystem caching system (folder navigate)
Auto fixed with eslint
The RecordVO constructor was changed in commit a1f3250. Update the call
to the constructor in the FolderVO constructor.

PER-9468: Integrate filesystem caching system (folder navigate)
@meisekimiu meisekimiu force-pushed the folder-caching-implementation branch from bfe2ab6 to 3a64b86 Compare May 2, 2024 14:33
Copy link

@k8lyn6 k8lyn6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Followed your instructions @meisekimiu and everything looked good to me! And share and public folders are working as expected too. Thanks!

@meisekimiu meisekimiu merged commit bbd7fa9 into main May 7, 2024
5 checks passed
@meisekimiu meisekimiu deleted the folder-caching-implementation branch May 7, 2024 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants