@opencloning/store 1.9.2 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/package.json +1 -1
- package/src/cloning.js +4 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @opencloning/store
|
|
2
2
|
|
|
3
|
+
## 2.0.0
|
|
4
|
+
|
|
5
|
+
## 1.10.0
|
|
6
|
+
|
|
7
|
+
## 1.9.5
|
|
8
|
+
|
|
9
|
+
## 1.9.4
|
|
10
|
+
|
|
11
|
+
## 1.9.3
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#762](https://github.com/OpenCloning/OpenCloning_frontend/pull/762) [`df69a1b`](https://github.com/OpenCloning/OpenCloning_frontend/commit/df69a1bfb3b3128e93d89eef48a29f81a54ebb82) Thanks [@manulera](https://github.com/manulera)! - Fix QuotaExceededError when adding more than ~10 AB1/sequencing files (OpenCloning/OpenCloning#82). The raw contents of the verification files used to be persisted in Web Storage (localStorage, later sessionStorage), which has a quota of ~5 MB, so submitting around 10+ AB1 files failed with `QuotaExceededError` and the files/alignments disappeared. The contents are now kept in an in-memory store for the duration of the tab session, which has no quota.
|
|
16
|
+
|
|
3
17
|
## 1.9.2
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/package.json
CHANGED
package/src/cloning.js
CHANGED
|
@@ -1,17 +1,7 @@
|
|
|
1
1
|
import { createSlice } from '@reduxjs/toolkit';
|
|
2
2
|
import { doesSourceHaveOutput, getNextUniqueId } from './cloning_utils';
|
|
3
3
|
import { convertToTeselaJson } from '@opencloning/utils/readNwrite';
|
|
4
|
-
|
|
5
|
-
function deleteFilesFromSessionStorage(sequenceId, fileName = null) {
|
|
6
|
-
Object.keys(sessionStorage)
|
|
7
|
-
.filter((key) => {
|
|
8
|
-
let query = `verification-${sequenceId}-`;
|
|
9
|
-
if (fileName) {
|
|
10
|
-
query += fileName;
|
|
11
|
-
}
|
|
12
|
-
return key.startsWith(query);
|
|
13
|
-
}).forEach((key) => sessionStorage.removeItem(key));
|
|
14
|
-
}
|
|
4
|
+
import { removeVerificationFileContents } from '@opencloning/utils/verificationFileStore';
|
|
15
5
|
|
|
16
6
|
const initialState = {
|
|
17
7
|
mainSequenceId: null,
|
|
@@ -269,7 +259,7 @@ const reducer = {
|
|
|
269
259
|
state.files = state.files.filter((f) => !sequences2delete.includes(f.sequence_id));
|
|
270
260
|
sequences2delete.forEach((e) => {
|
|
271
261
|
delete state.teselaJsonCache[e];
|
|
272
|
-
|
|
262
|
+
removeVerificationFileContents(e, null);
|
|
273
263
|
});
|
|
274
264
|
},
|
|
275
265
|
|
|
@@ -395,12 +385,13 @@ const reducer = {
|
|
|
395
385
|
removeFile(state, action) {
|
|
396
386
|
const { fileName, sequenceId } = action.payload;
|
|
397
387
|
state.files = state.files.filter((f) => f.file_name !== fileName || f.sequence_id !== sequenceId);
|
|
388
|
+
removeVerificationFileContents(sequenceId, fileName);
|
|
398
389
|
},
|
|
399
390
|
|
|
400
391
|
removeFilesAssociatedToSequence(state, action) {
|
|
401
392
|
const sequenceId = action.payload;
|
|
402
393
|
state.files = state.files.filter((f) => f.sequence_id !== sequenceId);
|
|
403
|
-
|
|
394
|
+
removeVerificationFileContents(sequenceId, null);
|
|
404
395
|
},
|
|
405
396
|
|
|
406
397
|
addDatabaseIdToSequence(state, action) {
|