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

Clear cache when serving NWB files to Neurosift and other services #974

Open
rly opened this issue Mar 5, 2025 · 1 comment · May be fixed by #975
Open

Clear cache when serving NWB files to Neurosift and other services #974

rly opened this issue Mar 5, 2025 · 1 comment · May be fixed by #975
Labels
bug Something isn't working

Comments

@rly
Copy link
Collaborator

rly commented Mar 5, 2025

Describe the issue

A user I am working with was iteratively creating NWB files and using NWB GUIDE > Neurosift to visualize the file. The NWB file is only ~75 MB. The user would modify the file but the changes were not reflected in NWB GUIDE > Neurosift. The file was indeed changed as confirmed by PyNWB. It turns out that Electron has a cache and something, probably the NWB file, is being cached and served when the file with the same path (but different create/modify date and size) is requested.

See https://stackoverflow.com/a/44675132/20177

Deleting /Users/<user>/Library/Application Support/NWB GUIDE/Cache was insufficient, but deleting /Users/<user>/Library/Application Support/NWB GUIDE/ worked.

It might be that if the file is much larger, it would not be cached.

GUIDE should clear the Electron cache (or not use the cache) when serving NWB files to Neurosift and other services like DANDI Upload.

Steps to Reproduce

^

Operating System

Mac

GUIDE Version

1.0.4

Code of Conduct

Yes

Did you confirm this issue was not already reported?

Yes

@rly rly added the bug Something isn't working label Mar 5, 2025
@rly
Copy link
Collaborator Author

rly commented Mar 7, 2025

It looks like the structure of the NWB file is cached in the browser/Electron's IndexedDB in the neurosift-hdf5-cache database, so changes to the structure, e.g., renaming groups, adding columns to a table, changing attributes, will not be reflected unless the cache is cleared.

Image

It seems that changing values of datasets is reflected, however.

Disabling the cache / deleting the storage data is especially important now that after #970, when serving files to Neurosift, different files might map to the same URL. For example, "http://127.0.0.1:4242//files/0:/processing" might be created when loading a file on the first run of NWB GUIDE. After GUIDE is closed and reopened and a new file is explored with Neurosift, "http://127.0.0.1:4242//files/0:/processing" should point to a new file, but the key/value pairs were cached, and so the incorrect values will be loaded. Indeed, I tested this and on the second load of File B, the hierarchy of file A from the first load was shown.

@rly rly linked a pull request Mar 7, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant