fix(studio): harden organize-imports against long-running queries and hangs
The original GET route used a correlated NOT EXISTS / FIND_IN_SET subquery over the entire catalog_items table for every recent import audit entry, causing server timeouts when the audit log or catalog grew large. The per-item host-page validation inside the create action also issued one SELECT + one UPDATE per moved offer. Changes: - GET /api/admin/import/organize: replace the correlated subquery with a bounded candidate list and a JS-side placed-set check, then resolve all needed base items in a single indexed SELECT. This bounds the query cost regardless of catalog or audit log size. - organizeImportFurni action: validate mover ids in one SELECT, then batch every move per group into a single UPDATE with a CASE expression instead of one UPDATE per item. - OrganizeImportsDialog: add a 45-second abort timeout on the fetch and a distinct load-error state so the UI never silently hangs. - Add 'loadError' translation key (en + nl).
This commit is contained in:
1 parent
01a85ebcd0
commit
19dc0347df
5 files changed
+181
-66
No files matched your search
@@ -2204,6 +2204,7 @@
|
||||
"itemsBadge": "{count} items",
|
||||
"loading": "Loading imported furniture…",
|
||||
"empty": "No imported furniture found. Import furniture first.",
|
||||
"loadError": "Could not load imports. Try again.",
|
||||
"refresh": "Refresh",
|
||||
"desc": "Imported furniture is grouped into suggested pages. Review each group, then create the pages you approve.",
|
||||
"selectAll": "Select all",
|
||||
|
||||
Reference in new issue
Block a user