Skip to content

Fix QuotaExceededError when adding many AB1/sequencing files (OpenClo… - #755

Open
Red-Skuller wants to merge 1 commit into
OpenCloning:masterfrom
Red-Skuller:fix/verification-files-quota-82
Open

Fix QuotaExceededError when adding many AB1/sequencing files (OpenClo…#755
Red-Skuller wants to merge 1 commit into
OpenCloning:masterfrom
Red-Skuller:fix/verification-files-quota-82

Conversation

@Red-Skuller

Copy link
Copy Markdown

Fix QuotaExceededError when adding many AB1/sequencing files (OpenCloning/OpenCloning#82)

The raw contents of verification (sequencing) files were persisted in Web Storage (localStorage in v1.3.1, sessionStorage since the monorepo switch) under 'verification-<sequence_id>-<file_name>' keys. Web Storage has a quota of ~5 MB, so submitting ~10+ AB1 files (e.g. 12 files / 3.9 MiB -> ~5.5 MB in base64) threw a QuotaExceededError and the files/alignments silently disappeared.

The contents are now kept in a small in-memory store for the duration of the tab session (same lifetime semantics as before, no quota). They are only needed while the tab is open: alignments are rendered from them, they are downloaded and exported to zips from them, and new uploads re-align against them. After a page reload the cloning strategy is loaded from a file or the database again together with its verification files.

  • add packages/utils/src/utils/verificationFileStore.js (in-memory store, exposed on window.verificationFileStore when running in Cypress, following the existing window.store pattern)
  • use it in VerificationFileDialog, useStoreEditor, useCloningHistoryLoader, useInitializeApp, thunks (CopySequenceThunk), readNwrite (downloadStateAsZip, loadFilesToVerificationStore; loadFilesToSessionStorage kept as a deprecated alias) and the cloning store reducer
  • update the cypress component and e2e specs to assert on the in-memory store
  • add unit tests (verificationFileStore.test.js) and a jsdom component test (VerificationFileDialog.test.jsx) that uploads 12 real ~346 KB AB1 files (~5.5 MB in base64, above the 5 MB Web Storage quota) and verifies all files are stored, downloadable and removable with Web Storage untouched

…ning/OpenCloning#82)

The raw contents of verification (sequencing) files were persisted in Web
Storage (localStorage in v1.3.1, sessionStorage since the monorepo switch)
under 'verification-<sequence_id>-<file_name>' keys. Web Storage has a quota
of ~5 MB, so submitting ~10+ AB1 files (e.g. 12 files / 3.9 MiB -> ~5.5 MB in
base64) threw a QuotaExceededError and the files/alignments silently
disappeared.

The contents are now kept in a small in-memory store for the duration of the
tab session (same lifetime semantics as before, no quota). They are only
needed while the tab is open: alignments are rendered from them, they are
downloaded and exported to zips from them, and new uploads re-align against
them. After a page reload the cloning strategy is loaded from a file or the
database again together with its verification files.

- add packages/utils/src/utils/verificationFileStore.js (in-memory store,
  exposed on window.verificationFileStore when running in Cypress, following
  the existing window.store pattern)
- use it in VerificationFileDialog, useStoreEditor, useCloningHistoryLoader,
  useInitializeApp, thunks (CopySequenceThunk), readNwrite
  (downloadStateAsZip, loadFilesToVerificationStore; loadFilesToSessionStorage
  kept as a deprecated alias) and the cloning store reducer
- update the cypress component and e2e specs to assert on the in-memory store
- add unit tests (verificationFileStore.test.js) and a jsdom component test
  (VerificationFileDialog.test.jsx) that uploads 12 real ~346 KB AB1 files
  (~5.5 MB in base64, above the 5 MB Web Storage quota) and verifies all
  files are stored, downloadable and removable with Web Storage untouched
@changeset-bot

changeset-bot Bot commented Aug 30, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a0d50cb

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 10 packages
Name Type
@opencloning/utils Patch
@opencloning/store Patch
@opencloning/ui Patch
opencloning Patch
opencloningdb Patch
standalone-app Patch
syntax-builder Patch
test-app Patch
@opencloning/opencloning-elabftw Patch
@opencloning/opencloningdb Patch

Not sure what this means? Click here to learn what changesets are.

[Click here if you're a maintainer who wants to add another changeset to this PR](https://github.com/Red-Skuller/OpenCloning_frontend/new/fix/verification-files-quota-82?filename=.changeset/seven-hairs-fail.md&value=---%0A%22%40opencloning%2Fstore%22%3A%20patch%0A%22%40opencloning%2Fui%22%3A%20patch%0A%22%40opencloning%2Futils%22%3A%20patch%0A---%0A%0AFix%20QuotaExceededError%20when%20adding%20many%20AB1%2Fsequencing%20files%20(OpenClo%E2%80%A6%0A)

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.

2 participants