V3 Hardening & Fixes: Structured Errors, JWT Fallbacks, and Module Stability
- Implemented Structured Error Handling across GET/POST/PATCH helpers to extract rich V3 error metadata. - Added direct localStorage fallback for JWT detection to resolve race conditions during initial page load. - Fixed async race condition in Archives leading to 'archive_content_li is undefined' crash. - Hardened generic object processor to handle non-array API responses gracefully. - Resolved zero-result bug in Event Search by using raw 'account_id_random' to bypass backend mapping conflicts. - Isolated bootstrap headers in +layout.ts and removed invalid response headers from request config. - Enhanced /testing dashboard with live header inspection and V3 hardening audits.
This commit is contained in:
@@ -45,7 +45,8 @@ export async function load_ae_obj_id__archive({
|
||||
obj_type: 'archive',
|
||||
obj_id: archive_id,
|
||||
view,
|
||||
params,
|
||||
// Only pass view and specific params to avoid 422 validation errors on single-obj endpoints
|
||||
params: params,
|
||||
log_lvl: log_lvl
|
||||
})
|
||||
.then(async function (archive_obj_get_result) {
|
||||
@@ -170,9 +171,11 @@ export async function load_ae_obj_li__archive({
|
||||
}
|
||||
});
|
||||
|
||||
if (inc_content_li && ae_promises.load__archive_obj_li) {
|
||||
for (let i = 0; i < ae_promises.load__archive_obj_li.length; i++) {
|
||||
const archive_obj = ae_promises.load__archive_obj_li[i];
|
||||
const archive_obj_li = await ae_promises.load__archive_obj_li;
|
||||
|
||||
if (inc_content_li && archive_obj_li && Array.isArray(archive_obj_li)) {
|
||||
for (let i = 0; i < archive_obj_li.length; i++) {
|
||||
const archive_obj = archive_obj_li[i];
|
||||
const archive_id = archive_obj.archive_id_random;
|
||||
|
||||
const content_li = await load_ae_obj_li__archive_content({
|
||||
@@ -187,11 +190,11 @@ export async function load_ae_obj_li__archive({
|
||||
try_cache,
|
||||
log_lvl
|
||||
});
|
||||
ae_promises.load__archive_obj_li[i].archive_content_li = content_li;
|
||||
archive_obj_li[i].archive_content_li = content_li;
|
||||
}
|
||||
}
|
||||
|
||||
return ae_promises.load__archive_obj_li;
|
||||
return archive_obj_li;
|
||||
}
|
||||
|
||||
// Updated 2026-01-06
|
||||
|
||||
@@ -335,7 +335,7 @@ async function _process_generic_props<T extends Record<string, any>>({
|
||||
log_lvl?: number;
|
||||
specific_processor?: (obj: T) => Promise<T> | T;
|
||||
}): Promise<T[]> {
|
||||
if (!obj_li || obj_li.length === 0) return [];
|
||||
if (!obj_li || !Array.isArray(obj_li) || obj_li.length === 0) return [];
|
||||
|
||||
const processed_obj_li: T[] = [];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user