refactor(events): harden V3 String-Only ID vision and fix Session Alert store error
- Standardized Event module logic files to strictly use random string IDs, ensuring frontend consistency and avoiding 'Integer Trap' 404s. - Refactored 'ae_comp__event_session_alert.svelte' to accept a plain object instead of a store/observable, resolving the 'store_invalid_shape' error in list loops. - Updated all callers of the alert component to pass unwrapped session objects. - Cleaned up event-related UI components to remove redundant '_random' field lookups and align with V3 CRUD patterns. - Updated project metadata (GEMINI.md, TODO.md) to reflect the new memory structure and latest hardened state.
This commit is contained in:
@@ -9,7 +9,7 @@ import { load_ae_obj_li__event_file } from '$lib/ae_events/ae_events__event_file
|
||||
|
||||
const ae_promises: key_val = {};
|
||||
|
||||
// Updated 2026-01-20 to V3
|
||||
// Updated 2026-01-27 to V3 String-Only ID Standard
|
||||
export async function load_ae_obj_id__event_presenter({
|
||||
api_cfg,
|
||||
event_presenter_id,
|
||||
@@ -30,7 +30,7 @@ export async function load_ae_obj_id__event_presenter({
|
||||
}
|
||||
|
||||
try {
|
||||
ae_promises.load__event_presenter_obj = await api.get_ae_obj_v3({
|
||||
const result = await api.get_ae_obj_v3({
|
||||
api_cfg,
|
||||
obj_type: 'event_presenter',
|
||||
obj_id: event_presenter_id,
|
||||
@@ -38,16 +38,18 @@ export async function load_ae_obj_id__event_presenter({
|
||||
log_lvl
|
||||
});
|
||||
|
||||
if (ae_promises.load__event_presenter_obj) {
|
||||
if (result) {
|
||||
const processed = await process_ae_obj__event_presenter_props({
|
||||
obj_li: [result],
|
||||
log_lvl
|
||||
});
|
||||
ae_promises.load__event_presenter_obj = processed[0];
|
||||
|
||||
if (try_cache) {
|
||||
const processed_obj_li = await process_ae_obj__event_presenter_props({
|
||||
obj_li: [ae_promises.load__event_presenter_obj],
|
||||
log_lvl
|
||||
});
|
||||
await db_save_ae_obj_li__ae_obj({
|
||||
db_instance: db_events,
|
||||
table_name: 'presenter',
|
||||
obj_li: processed_obj_li,
|
||||
obj_li: [ae_promises.load__event_presenter_obj],
|
||||
properties_to_save,
|
||||
log_lvl
|
||||
});
|
||||
@@ -79,7 +81,7 @@ export async function load_ae_obj_id__event_presenter({
|
||||
return ae_promises.load__event_presenter_obj;
|
||||
}
|
||||
|
||||
// Updated 2026-01-20 to V3
|
||||
// Updated 2026-01-27 to V3 String-Only ID Standard
|
||||
export async function load_ae_obj_li__event_presenter({
|
||||
api_cfg,
|
||||
for_obj_type = 'event_presentation',
|
||||
@@ -115,7 +117,7 @@ export async function load_ae_obj_li__event_presenter({
|
||||
}
|
||||
|
||||
try {
|
||||
ae_promises.load__event_presenter_obj_li = await api.get_ae_obj_li_v3({
|
||||
const result_li = await api.get_ae_obj_li_v3({
|
||||
api_cfg,
|
||||
obj_type: 'event_presenter',
|
||||
for_obj_type,
|
||||
@@ -128,16 +130,18 @@ export async function load_ae_obj_li__event_presenter({
|
||||
log_lvl
|
||||
});
|
||||
|
||||
if (ae_promises.load__event_presenter_obj_li) {
|
||||
if (result_li) {
|
||||
const processed = await process_ae_obj__event_presenter_props({
|
||||
obj_li: result_li,
|
||||
log_lvl
|
||||
});
|
||||
ae_promises.load__event_presenter_obj_li = processed;
|
||||
|
||||
if (try_cache) {
|
||||
const processed_obj_li = await process_ae_obj__event_presenter_props({
|
||||
obj_li: ae_promises.load__event_presenter_obj_li,
|
||||
log_lvl
|
||||
});
|
||||
await db_save_ae_obj_li__ae_obj({
|
||||
db_instance: db_events,
|
||||
table_name: 'presenter',
|
||||
obj_li: processed_obj_li,
|
||||
obj_li: ae_promises.load__event_presenter_obj_li,
|
||||
properties_to_save,
|
||||
log_lvl
|
||||
});
|
||||
@@ -158,7 +162,7 @@ export async function load_ae_obj_li__event_presenter({
|
||||
|
||||
if (inc_file_li && ae_promises.load__event_presenter_obj_li) {
|
||||
for (const presenter of ae_promises.load__event_presenter_obj_li) {
|
||||
const current_presenter_id = presenter.event_presenter_id_random || presenter.event_presenter_id || presenter.id;
|
||||
const current_presenter_id = presenter.id || presenter.event_presenter_id;
|
||||
presenter.event_file_li = await load_ae_obj_li__event_file({
|
||||
api_cfg,
|
||||
for_obj_type: 'event_presenter',
|
||||
@@ -200,29 +204,34 @@ export async function create_ae_obj__event_presenter({
|
||||
api_cfg,
|
||||
obj_type: 'event_presenter',
|
||||
fields: {
|
||||
event_id_random: event_id,
|
||||
event_session_id_random: event_session_id,
|
||||
event_presentation_id_random: event_presentation_id,
|
||||
event_id,
|
||||
event_session_id,
|
||||
event_presentation_id,
|
||||
...data_kv
|
||||
},
|
||||
log_lvl
|
||||
});
|
||||
|
||||
if (result && try_cache) {
|
||||
const processed_obj_li = await process_ae_obj__event_presenter_props({
|
||||
if (result) {
|
||||
const processed = await process_ae_obj__event_presenter_props({
|
||||
obj_li: [result],
|
||||
log_lvl
|
||||
});
|
||||
await db_save_ae_obj_li__ae_obj({
|
||||
db_instance: db_events,
|
||||
table_name: 'presenter',
|
||||
obj_li: processed_obj_li,
|
||||
properties_to_save,
|
||||
log_lvl
|
||||
});
|
||||
const processed_obj = processed[0];
|
||||
|
||||
if (try_cache) {
|
||||
await db_save_ae_obj_li__ae_obj({
|
||||
db_instance: db_events,
|
||||
table_name: 'presenter',
|
||||
obj_li: [processed_obj],
|
||||
properties_to_save,
|
||||
log_lvl
|
||||
});
|
||||
}
|
||||
return processed_obj;
|
||||
}
|
||||
|
||||
return result;
|
||||
return null;
|
||||
}
|
||||
|
||||
// Updated 2026-01-20 to V3
|
||||
@@ -284,21 +293,26 @@ export async function update_ae_obj__event_presenter({
|
||||
log_lvl
|
||||
});
|
||||
|
||||
if (result && try_cache) {
|
||||
const processed_obj_li = await process_ae_obj__event_presenter_props({
|
||||
if (result) {
|
||||
const processed = await process_ae_obj__event_presenter_props({
|
||||
obj_li: [result],
|
||||
log_lvl
|
||||
});
|
||||
await db_save_ae_obj_li__ae_obj({
|
||||
db_instance: db_events,
|
||||
table_name: 'presenter',
|
||||
obj_li: processed_obj_li,
|
||||
properties_to_save,
|
||||
log_lvl
|
||||
});
|
||||
const processed_obj = processed[0];
|
||||
|
||||
if (try_cache) {
|
||||
await db_save_ae_obj_li__ae_obj({
|
||||
db_instance: db_events,
|
||||
table_name: 'presenter',
|
||||
obj_li: [processed_obj],
|
||||
properties_to_save,
|
||||
log_lvl
|
||||
});
|
||||
}
|
||||
return processed_obj;
|
||||
}
|
||||
|
||||
return result;
|
||||
return null;
|
||||
}
|
||||
|
||||
// Updated 2026-01-21 to Restore Full Aether Search Logic
|
||||
@@ -341,7 +355,7 @@ export async function search__event_presenter({
|
||||
|
||||
const search_query: any = {
|
||||
q: '',
|
||||
and: [{ field: 'event_id_random', op: 'eq', value: event_id }]
|
||||
and: [{ field: 'event_id', op: 'eq', value: event_id }]
|
||||
};
|
||||
|
||||
const params: key_val = {};
|
||||
@@ -376,21 +390,25 @@ export async function search__event_presenter({
|
||||
log_lvl
|
||||
});
|
||||
|
||||
if (result_li && try_cache) {
|
||||
const processed_obj_li = await process_ae_obj__event_presenter_props({
|
||||
if (result_li) {
|
||||
const processed = await process_ae_obj__event_presenter_props({
|
||||
obj_li: result_li,
|
||||
log_lvl
|
||||
});
|
||||
await db_save_ae_obj_li__ae_obj({
|
||||
db_instance: db_events,
|
||||
table_name: 'presenter',
|
||||
obj_li: processed_obj_li,
|
||||
properties_to_save,
|
||||
log_lvl
|
||||
});
|
||||
|
||||
if (try_cache) {
|
||||
await db_save_ae_obj_li__ae_obj({
|
||||
db_instance: db_events,
|
||||
table_name: 'presenter',
|
||||
obj_li: processed,
|
||||
properties_to_save,
|
||||
log_lvl
|
||||
});
|
||||
}
|
||||
return processed;
|
||||
}
|
||||
|
||||
return result_li || [];
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -528,6 +546,7 @@ async function _process_generic_props<T extends Record<string, any>>({
|
||||
(processed_obj as any)[newKey] = processed_obj[key];
|
||||
}
|
||||
}
|
||||
// String-Only ID Vision: Map [obj_type]_id_random to 'id'
|
||||
const randomIdKey = `${obj_type}_id_random`;
|
||||
if (processed_obj[randomIdKey]) {
|
||||
(processed_obj as any).id = processed_obj[randomIdKey];
|
||||
|
||||
Reference in New Issue
Block a user