@striae-org/striae 6.1.1 → 6.1.3
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/app/components/actions/case-import/storage-operations.ts +32 -2
- package/package.json +4 -3
- package/shared/types/annotation-literals.ts +5 -0
- package/workers/audit-worker/package.json +1 -1
- package/workers/audit-worker/wrangler.jsonc.example +1 -1
- package/workers/data-worker/package.json +1 -1
- package/workers/data-worker/wrangler.jsonc.example +1 -1
- package/workers/image-worker/package.json +1 -1
- package/workers/image-worker/wrangler.jsonc.example +1 -1
- package/workers/pdf-worker/package.json +1 -1
- package/workers/pdf-worker/wrangler.jsonc.example +1 -1
- package/workers/user-worker/package.json +1 -1
- package/workers/user-worker/wrangler.jsonc.example +1 -1
- package/wrangler.toml.example +1 -1
|
@@ -2,6 +2,7 @@ import type { User } from 'firebase/auth';
|
|
|
2
2
|
import { fetchDataApi } from '~/utils/api';
|
|
3
3
|
import {
|
|
4
4
|
getUserReadOnlyCases,
|
|
5
|
+
removeCaseConfirmationSummary,
|
|
5
6
|
updateUserData,
|
|
6
7
|
validateUserSession
|
|
7
8
|
} from '~/utils/data';
|
|
@@ -206,6 +207,14 @@ export async function deleteReadOnlyCase(user: User, caseNumber: string): Promis
|
|
|
206
207
|
);
|
|
207
208
|
};
|
|
208
209
|
|
|
210
|
+
const removeConfirmationSummary = async (): Promise<void> => {
|
|
211
|
+
try {
|
|
212
|
+
await removeCaseConfirmationSummary(user, caseNumber);
|
|
213
|
+
} catch (summaryError) {
|
|
214
|
+
console.warn(`Failed to remove confirmation summary for case ${caseNumber}:`, summaryError);
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
|
|
209
218
|
let caseDataDeleteHadFailure = false;
|
|
210
219
|
|
|
211
220
|
try {
|
|
@@ -219,8 +228,26 @@ export async function deleteReadOnlyCase(user: User, caseNumber: string): Promis
|
|
|
219
228
|
);
|
|
220
229
|
|
|
221
230
|
if (caseResponse.status === 404) {
|
|
222
|
-
// No backing data object exists
|
|
223
|
-
|
|
231
|
+
// No backing data object exists.
|
|
232
|
+
// Treat this as successful idempotent cleanup even if metadata was already removed.
|
|
233
|
+
try {
|
|
234
|
+
const removedFromMetadata = await removeReadOnlyCase(user, caseNumber);
|
|
235
|
+
|
|
236
|
+
if (!removedFromMetadata) {
|
|
237
|
+
console.info(
|
|
238
|
+
`Read-only case ${caseNumber} metadata was already absent during 404 cleanup.`
|
|
239
|
+
);
|
|
240
|
+
}
|
|
241
|
+
} catch (removeMetadataError) {
|
|
242
|
+
console.warn(
|
|
243
|
+
`Failed metadata cleanup for read-only case ${caseNumber} during 404 cleanup:`,
|
|
244
|
+
removeMetadataError
|
|
245
|
+
);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
// Safe/idempotent cleanup; run regardless of metadata state.
|
|
249
|
+
await removeConfirmationSummary();
|
|
250
|
+
|
|
224
251
|
return true;
|
|
225
252
|
}
|
|
226
253
|
|
|
@@ -296,6 +323,8 @@ export async function deleteReadOnlyCase(user: User, caseNumber: string): Promis
|
|
|
296
323
|
return false;
|
|
297
324
|
}
|
|
298
325
|
|
|
326
|
+
await removeConfirmationSummary();
|
|
327
|
+
|
|
299
328
|
if (caseDataDeleteHadFailure) {
|
|
300
329
|
console.warn(
|
|
301
330
|
`Read-only case ${caseNumber} removed from metadata with partial storage cleanup failures.`
|
|
@@ -311,6 +340,7 @@ export async function deleteReadOnlyCase(user: User, caseNumber: string): Promis
|
|
|
311
340
|
try {
|
|
312
341
|
const removedFromMetadata = await removeReadOnlyCase(user, caseNumber);
|
|
313
342
|
if (removedFromMetadata) {
|
|
343
|
+
await removeConfirmationSummary();
|
|
314
344
|
console.warn(
|
|
315
345
|
`Read-only case ${caseNumber} removed from metadata during error fallback. ` +
|
|
316
346
|
'Some backing storage may require manual cleanup.'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@striae-org/striae",
|
|
3
|
-
"version": "6.1.
|
|
3
|
+
"version": "6.1.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Striae is a specialized, cloud-native platform designed to streamline forensic firearms identification by providing an intuitive environment for digital comparison image annotation, authenticated confirmations, and automated report generation.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
"functions/",
|
|
42
42
|
"public/",
|
|
43
43
|
"workers/",
|
|
44
|
+
"shared/",
|
|
44
45
|
"!workers/*/.wrangler",
|
|
45
46
|
"!workers/*/package-lock.json",
|
|
46
47
|
"!workers/*/worker-configuration.d.ts",
|
|
@@ -102,7 +103,7 @@
|
|
|
102
103
|
"dependencies": {
|
|
103
104
|
"@react-router/cloudflare": "^7.14.1",
|
|
104
105
|
"firebase": "^12.12.0",
|
|
105
|
-
"isbot": "^5.1.
|
|
106
|
+
"isbot": "^5.1.39",
|
|
106
107
|
"jszip": "^3.10.1",
|
|
107
108
|
"qrcode": "^1.5.4",
|
|
108
109
|
"react": "^19.2.5",
|
|
@@ -122,7 +123,7 @@
|
|
|
122
123
|
"eslint-plugin-import": "^2.32.0",
|
|
123
124
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
124
125
|
"eslint-plugin-react": "^7.37.5",
|
|
125
|
-
"eslint-plugin-react-hooks": "^7.0
|
|
126
|
+
"eslint-plugin-react-hooks": "^7.1.0",
|
|
126
127
|
"firebase-admin": "^13.8.0",
|
|
127
128
|
"modern-normalize": "^3.0.1",
|
|
128
129
|
"typescript": "^5.9.3",
|
package/wrangler.toml.example
CHANGED