Hardening: Restore V3 Search legacy compatibility and fix Hosted File specialized delete logic
- Restored legacy query aliases (qry_ae_obj_li__event, qry__event_file, etc.) across Event modules to fix build errors.
- Fixed Hosted File deletion logic in core__hosted_files.ts to use specialized /hosted_file/{id} endpoint with fake_delete support.
- Standardized ID field usage (hosted_file_id vs hosted_file_id_random) in Archive Content and Event File upload components.
- Updated TODO.md to reflect completed search restoration tasks.
This commit is contained in:
5
TODO.md
5
TODO.md
@@ -10,8 +10,8 @@ This is a list of tasks to be completed before the next event/show/conference.
|
||||
- [ ] Update `ae_comp__journal_entry_obj_qry.svelte` to use dynamic `$journals_loc` values for `enabled` and `hidden` parameters instead of hardcoded strings.
|
||||
- [ ] Verify that the search results correctly respect these filters.
|
||||
2. **Hardening V3 Search (Continued):**
|
||||
- [ ] **Event Presenter Search:** Restore specialized business logic.
|
||||
- [ ] **Event Badge Search:** Restore specialized business logic.
|
||||
- [x] **Event Presenter Search:** Restore specialized business logic. (Completed 2026-01-21)
|
||||
- [x] **Event Badge Search:** Restore specialized business logic. (Completed 2026-01-21)
|
||||
- [ ] **Exhibit Search:** Restore missing search function and logic.
|
||||
- [ ] **IDAA Result Limit:** Fix the over-fetching issue where the `limit` parameter is ignored after client-side filtering.
|
||||
|
||||
@@ -23,6 +23,7 @@ This is a list of tasks to be completed before the next event/show/conference.
|
||||
- [x] **Event Session Search:** Finalized and verified. Added `default_qry_str` to V3 body. (Completed 2026-01-21)
|
||||
- [x] **IDAA Recovery Meetings Search:** Restored functionality using V3 `search__event` with `default_qry_str`. (Completed 2026-01-21)
|
||||
- [x] **Journal Entry Search:** Fixed `match` operator error (switched to `like`) and resolved iteration crashes by unwrapping API envelopes. (Completed 2026-01-21)
|
||||
- [x] **Legacy Compatibility:** Restored `qry_ae_obj_li__event`, `qry__event_file`, `qry__event_session`, and `qry__event_badge` aliases to resolve build errors and support Reports. (Completed 2026-01-21)
|
||||
- [ ] **Global Rule:** Preserve `ft_qry`, `lk_qry`, and `and_qry` blocks as "sacred" business logic. Never put non-searchable fields in the POST body.
|
||||
2. **Service Worker Reliability (Mitigated):**
|
||||
- [x] **Disable Auto-Registration:** Temporarily disabled `serviceWorker.register` in `svelte.config.js` to stop `TypeError` loop.
|
||||
|
||||
@@ -70,6 +70,11 @@
|
||||
|
||||
let input_element_id = 'ae_comp__hosted_files_upload__input';
|
||||
|
||||
if (log_lvl) {
|
||||
console.log(`*** ae_comp__hosted_files_upload.svelte ***`);
|
||||
console.log(`link_to_type: ${link_to_type} link_to_id: ${link_to_id}`);
|
||||
}
|
||||
|
||||
// *** Functions and Logic
|
||||
async function handle_submit_form_files(event: SubmitEvent) {
|
||||
console.log('*** handle_submit_form() ***');
|
||||
@@ -191,18 +196,18 @@
|
||||
console.log(result[x]);
|
||||
let hosted_file_obj = result[x];
|
||||
|
||||
let hosted_file_id = hosted_file_obj.hosted_file_id_random;
|
||||
let hosted_file_id = hosted_file_obj.hosted_file_id;
|
||||
|
||||
hosted_file_id_li.push(hosted_file_id);
|
||||
hosted_file_obj_li.push(hosted_file_obj);
|
||||
|
||||
let hosted_file_data: key_val = {};
|
||||
hosted_file_data['id'] = hosted_file_id;
|
||||
hosted_file_data['id'] = hosted_file_id; // Same as the hosted_file_id
|
||||
hosted_file_data['hosted_file_id'] = hosted_file_id;
|
||||
hosted_file_data['hosted_file_id_random'] = hosted_file_id;
|
||||
// hosted_file_data['hosted_file_id_random'] = hosted_file_id;
|
||||
hosted_file_data['for_type'] = link_to_type;
|
||||
hosted_file_data['for_id'] = link_to_id;
|
||||
hosted_file_data['for_id_random'] = link_to_id;
|
||||
// hosted_file_data['for_id_random'] = link_to_id;
|
||||
hosted_file_data['hash_sha256'] = hosted_file_obj.hash_sha256;
|
||||
hosted_file_data['filename'] = hosted_file_obj.filename;
|
||||
hosted_file_data['extension'] = hosted_file_obj.extension;
|
||||
@@ -215,6 +220,10 @@
|
||||
|
||||
hosted_file_obj_kv[hosted_file_id] = hosted_file_data;
|
||||
|
||||
if (log_lvl) {
|
||||
console.log(`hosted_file_data:`, hosted_file_data);
|
||||
}
|
||||
|
||||
return hosted_file_data;
|
||||
|
||||
// $ae_sess.files.new_upload_list[i].uploaded_bytes = 10; // fake 10 bytes at least...
|
||||
@@ -233,9 +242,9 @@
|
||||
|
||||
// return event_file_id;
|
||||
})
|
||||
.then(function (hosted_file_data) {
|
||||
return hosted_file_data;
|
||||
})
|
||||
// .then(function (hosted_file_data) {
|
||||
// return hosted_file_data;
|
||||
// })
|
||||
.catch(function (error: any) {
|
||||
console.log('Something went wrong.');
|
||||
console.log(error);
|
||||
@@ -245,7 +254,9 @@
|
||||
$slct_trigger = 'load__hosted_file_obj_li';
|
||||
});
|
||||
|
||||
console.log(ae_promises.upload__hosted_file_obj);
|
||||
if (log_lvl) {
|
||||
console.log(`Waiting for upload__hosted_file_obj promise...`);
|
||||
}
|
||||
let hosted_file_result = ae_promises.upload__hosted_file_obj;
|
||||
|
||||
return hosted_file_result;
|
||||
|
||||
@@ -138,13 +138,14 @@ export async function load_ae_obj_li__hosted_file({
|
||||
return ae_promises.load__hosted_file_obj_li || [];
|
||||
}
|
||||
|
||||
// Updated 2026-01-20 to V3
|
||||
// Updated 2026-01-22 to use special endpoint
|
||||
export async function delete_ae_obj_id__hosted_file({
|
||||
api_cfg,
|
||||
hosted_file_id,
|
||||
link_to_type,
|
||||
link_to_id,
|
||||
rm_orphan = false,
|
||||
fake_delete = false,
|
||||
try_cache = true,
|
||||
log_lvl = 0
|
||||
}: {
|
||||
@@ -153,15 +154,22 @@ export async function delete_ae_obj_id__hosted_file({
|
||||
link_to_type: string;
|
||||
link_to_id: string;
|
||||
rm_orphan?: boolean;
|
||||
fake_delete?: boolean;
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}) {
|
||||
// V3 generic delete with orphan cleanup parameters
|
||||
const result = await api.delete_ae_obj_v3({
|
||||
if (log_lvl) {
|
||||
console.log(`*** delete_ae_obj_id__hosted_file() *** [Special] id=${hosted_file_id}`);
|
||||
}
|
||||
|
||||
// Use the specialized hosted file delete endpoint
|
||||
const result = await api.delete_hosted_file({
|
||||
api_cfg,
|
||||
obj_type: 'hosted_file',
|
||||
obj_id: hosted_file_id,
|
||||
params: { link_to_type, link_to_id, rm_orphan },
|
||||
hosted_file_id,
|
||||
link_to_type,
|
||||
link_to_id,
|
||||
rm_orphan,
|
||||
params: { fake_delete },
|
||||
log_lvl
|
||||
});
|
||||
|
||||
|
||||
@@ -575,6 +575,8 @@ export async function search__event({
|
||||
return filtered_obj_li;
|
||||
}
|
||||
|
||||
export const qry_ae_obj_li__event = search__event;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -451,6 +451,8 @@ export async function search__event_badge({
|
||||
return ae_promises.search__event_badge_obj_li;
|
||||
}
|
||||
|
||||
export const qry__event_badge = search__event_badge;
|
||||
|
||||
// Updated 2025-10-06
|
||||
export const properties_to_save = [
|
||||
'id',
|
||||
|
||||
@@ -330,6 +330,8 @@ export async function search__event_file({
|
||||
return result_li || [];
|
||||
}
|
||||
|
||||
export const qry__event_file = search__event_file;
|
||||
|
||||
export const properties_to_save = [
|
||||
'id',
|
||||
'event_file_id',
|
||||
|
||||
@@ -474,6 +474,8 @@ export async function search__event_session({
|
||||
return result_li || [];
|
||||
}
|
||||
|
||||
export const qry__event_session = search__event_session;
|
||||
|
||||
/**
|
||||
* Send sign-in link to POC
|
||||
*/
|
||||
|
||||
@@ -189,9 +189,11 @@
|
||||
let hosted_file_id = hosted_file_obj.hosted_file_id_random;
|
||||
|
||||
let event_file_data: key_val = {};
|
||||
event_file_data['hosted_file_id_random'] = hosted_file_id;
|
||||
event_file_data['hosted_file_id'] = hosted_file_id;
|
||||
// event_file_data['hosted_file_id_random'] = hosted_file_id;
|
||||
event_file_data['for_type'] = link_to_type;
|
||||
event_file_data['for_id_random'] = link_to_id;
|
||||
event_file_data['for_id'] = link_to_id;
|
||||
// event_file_data['for_id_random'] = link_to_id;
|
||||
event_file_data['filename'] = hosted_file_obj.filename;
|
||||
event_file_data['extension'] = hosted_file_obj.extension;
|
||||
event_file_data['enable'] = true;
|
||||
|
||||
@@ -334,7 +334,7 @@
|
||||
api_cfg: $ae_api,
|
||||
archive_content_id: $idaa_slct.archive_content_id,
|
||||
data_kv: {
|
||||
hosted_file_id_random: hosted_file_obj_li[0].hosted_file_id_random,
|
||||
hosted_file_id: hosted_file_obj_li[0].hosted_file_id,
|
||||
// file_path: hosted_file_obj_li[0].file_path,
|
||||
filename: hosted_file_obj_li[0].filename,
|
||||
file_extension: hosted_file_obj_li[0].extension,
|
||||
@@ -384,7 +384,7 @@
|
||||
api_cfg: $ae_api,
|
||||
archive_content_id: $idaa_slct.archive_content_id,
|
||||
data_kv: {
|
||||
hosted_file_id_random: slct_hosted_file_id,
|
||||
hosted_file_id: slct_hosted_file_id,
|
||||
// file_path: hosted_file_obj_li[0].file_path,
|
||||
filename: slct_hosted_file_obj.filename,
|
||||
file_extension: slct_hosted_file_obj.extension,
|
||||
@@ -561,7 +561,7 @@
|
||||
bind:upload_complete={
|
||||
$idaa_slct.archive_content_obj.upload_complete
|
||||
}
|
||||
{log_lvl}
|
||||
log_lvl={1}
|
||||
>
|
||||
{#snippet label()}
|
||||
<span>
|
||||
@@ -629,7 +629,7 @@
|
||||
api_cfg: $ae_api,
|
||||
archive_content_id: $idaa_slct.archive_content_id,
|
||||
data_kv: {
|
||||
hosted_file_id_random: null,
|
||||
hosted_file_id: null,
|
||||
file_path: null,
|
||||
filename: null,
|
||||
file_extension: null,
|
||||
|
||||
Reference in New Issue
Block a user