Remove _random ID references and fix hosted file download ID
- Fix download button to use hosted_file_id instead of id (which resolved to event_file_id via _process_generic_props, hitting the wrong endpoint) - Fix Dexie file table query in event_file_obj_tbl_wrapper to use _id fields (the indexed ones) instead of _id_random variants - Remove _random fields from properties_to_save in event, event_session - Drop _id_random fallbacks from launcher device ID resolution and background sync heartbeat - Clean up dead comments and old FA anchor in post edit component - Update TODO__Agents.md: BGH section removed, CMSC/Axonius shows added, download button fix marked complete Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -128,10 +128,7 @@ $effect(() => {
|
||||
let ae_promises: key_val = $state({});
|
||||
|
||||
$effect(() => {
|
||||
const file_id =
|
||||
hosted_file_obj?.id ||
|
||||
hosted_file_obj?.hosted_file_id ||
|
||||
hosted_file_id;
|
||||
const file_id = hosted_file_obj?.hosted_file_id ?? hosted_file_id;
|
||||
if (file_id && $ae_sess?.api_download_kv[file_id]?.percent_completed) {
|
||||
download_percent = $ae_sess.api_download_kv[file_id].percent_completed;
|
||||
}
|
||||
@@ -139,10 +136,7 @@ $effect(() => {
|
||||
|
||||
// Reactive timer to alternate views during active download
|
||||
$effect(() => {
|
||||
const file_id =
|
||||
hosted_file_obj?.id ||
|
||||
hosted_file_obj?.hosted_file_id ||
|
||||
hosted_file_id;
|
||||
const file_id = hosted_file_obj?.hosted_file_id ?? hosted_file_id;
|
||||
const is_actively_downloading =
|
||||
ae_promises[file_id] && download_complete === undefined;
|
||||
|
||||
@@ -193,10 +187,7 @@ let direct_download_url = $derived.by(() => {
|
||||
});
|
||||
|
||||
async function handle_click() {
|
||||
const file_id =
|
||||
hosted_file_obj?.id ||
|
||||
hosted_file_obj?.hosted_file_id ||
|
||||
hosted_file_id;
|
||||
const file_id = hosted_file_obj?.hosted_file_id ?? hosted_file_id;
|
||||
download_complete = undefined;
|
||||
download_status_msg = 'Downloading...';
|
||||
|
||||
@@ -238,10 +229,7 @@ async function handle_click() {
|
||||
</script>
|
||||
|
||||
{#snippet content()}
|
||||
{@const file_id =
|
||||
hosted_file_obj?.id ||
|
||||
hosted_file_obj?.hosted_file_id ||
|
||||
hosted_file_id}
|
||||
{@const file_id = hosted_file_obj?.hosted_file_id ?? hosted_file_id}
|
||||
{#await ae_promises[file_id]}
|
||||
<div class="flex min-h-[1.5rem] w-full items-center">
|
||||
<div
|
||||
@@ -316,8 +304,7 @@ async function handle_click() {
|
||||
{/snippet}
|
||||
|
||||
{#if hosted_file_id && hosted_file_obj}
|
||||
{@const file_id =
|
||||
hosted_file_obj.id || hosted_file_obj.hosted_file_id || hosted_file_id}
|
||||
{@const file_id = hosted_file_obj.hosted_file_id ?? hosted_file_id}
|
||||
|
||||
{#if show_direct_download}
|
||||
<a
|
||||
|
||||
@@ -787,7 +787,7 @@ export const properties_to_save = [
|
||||
'event_id',
|
||||
'code',
|
||||
'account_id',
|
||||
'account_id_random',
|
||||
// 'account_id_random',
|
||||
'conference',
|
||||
'type',
|
||||
'name',
|
||||
|
||||
@@ -359,7 +359,7 @@ export async function create_event_file_obj_from_hosted_file_async({
|
||||
});
|
||||
|
||||
if (return_obj) return result;
|
||||
return result?.event_file_id || result?.id || result?.event_file_id_random;
|
||||
return result?.event_file_id || result?.id;
|
||||
}
|
||||
|
||||
export async function delete_ae_obj_id__event_file({
|
||||
|
||||
@@ -836,12 +836,12 @@ export async function email_sign_in__event_session({
|
||||
export const properties_to_save = [
|
||||
'id',
|
||||
'event_session_id',
|
||||
'event_session_id_random',
|
||||
// 'event_session_id_random',
|
||||
'external_id',
|
||||
'code',
|
||||
'for_type',
|
||||
'for_id',
|
||||
'for_id_random',
|
||||
// 'for_id_random',
|
||||
'type_code',
|
||||
'event_id',
|
||||
'event_location_id',
|
||||
|
||||
@@ -197,9 +197,7 @@ $effect(() => {
|
||||
untrack(() => {
|
||||
$events_slct.event_device_id =
|
||||
native_dev.event_device_id ||
|
||||
native_dev.id ||
|
||||
native_dev.event_device_id_random ||
|
||||
native_dev.id_random;
|
||||
native_dev.id;
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -370,9 +370,7 @@ async function run_device_heartbeat() {
|
||||
// String-Only ID Vision: Prioritize semantic string IDs, then generic, then legacy random strings
|
||||
const device_id =
|
||||
dev?.event_device_id ||
|
||||
dev?.id ||
|
||||
dev?.event_device_id_random ||
|
||||
dev?.id_random;
|
||||
dev?.id;
|
||||
|
||||
if (!device_id) {
|
||||
// Only log warning if we are actually supposed to be in native mode
|
||||
|
||||
@@ -77,10 +77,10 @@ let lq__event_obj = $derived(
|
||||
);
|
||||
|
||||
// It is important that these not be set to a value! It messes with the Dexie LiveQuery.
|
||||
// let event_file_id_random_li: Array<string> = $state();
|
||||
// let event_session_id_random_li: Array<string> = $state();
|
||||
// let event_presentation_id_random_li: Array<string>;
|
||||
// let event_presenter_id_random_li: Array<string> = $state();
|
||||
// let event_file_id_li: Array<string> = $state();
|
||||
// let event_session_id_li: Array<string> = $state();
|
||||
// let event_presentation_id_li: Array<string>;
|
||||
// let event_presenter_id_li: Array<string> = $state();
|
||||
|
||||
// let load_obj_li_results: Promise<any>|key_val;
|
||||
// let search_submit_results: Promise<any>|key_val;
|
||||
@@ -142,9 +142,11 @@ $effect(() => {
|
||||
</span>
|
||||
<!-- Reports for: -->
|
||||
{#if $lq__event_obj?.cfg_json?.short_name}
|
||||
<!-- eslint-disable-next-line svelte/no-at-html-tags -->
|
||||
{@html $lq__event_obj?.cfg_json.short_name ??
|
||||
ae_snip.html__not_set}
|
||||
{:else}
|
||||
<!-- eslint-disable-next-line svelte/no-at-html-tags -->
|
||||
{@html $lq__event_obj?.name ?? ae_snip.html__not_set}
|
||||
{/if}
|
||||
</h2>
|
||||
|
||||
@@ -18,7 +18,7 @@ interface Props {
|
||||
let {
|
||||
container_class_li = [],
|
||||
// display_mode = 'default',
|
||||
// event_file_id_random_li = $bindable(),
|
||||
// event_file_id_li = $bindable(),
|
||||
event_file_obj_li = $bindable(),
|
||||
link_to_type,
|
||||
link_to_id,
|
||||
@@ -55,9 +55,9 @@ $effect(() => {
|
||||
// let ae_tmp: key_val = {};
|
||||
// let ae_triggers: key_val = {};
|
||||
|
||||
let event_file_id_random_li: Array<string> = $state([]);
|
||||
// let event_file_id_li: Array<string> = $state([]);
|
||||
|
||||
let dq__where_type_id_val = $derived(`${link_to_type}_id_random`);
|
||||
let dq__where_type_id_val = $derived(`${link_to_type}_id`);
|
||||
let dq__where_eq_id_val = $derived(link_to_id ?? '');
|
||||
|
||||
// *** Functions and Logic
|
||||
@@ -122,7 +122,7 @@ let lq__event_file_obj_li = $derived(
|
||||
</script>
|
||||
|
||||
{#if event_file_obj_li && event_file_obj_li?.length}
|
||||
<!-- {#if event_file_id_random_li && event_file_id_random_li?.length} -->
|
||||
<!-- {#if event_file_id_li && event_file_id_li?.length} -->
|
||||
<Comp_event_file_obj_tbl
|
||||
{container_class_li}
|
||||
{lq__event_file_obj_li}
|
||||
|
||||
@@ -595,15 +595,6 @@ $effect(() => {
|
||||
{#each $idaa_slct.post_obj.linked_li_json as linked_obj, index (linked_obj.hosted_file_id ?? index)}
|
||||
<span
|
||||
class="flex flex-col items-center gap-1 rounded-lg border bg-white/50 p-1">
|
||||
<!-- <a
|
||||
href={linked_obj.url}
|
||||
target="_blank"
|
||||
class="badge badge-info variant-filled-info"
|
||||
>
|
||||
<span class="fas fa-paperclip m-1"></span>
|
||||
{linked_obj.filename}
|
||||
({linked_obj.hosted_file_id})
|
||||
</a> -->
|
||||
|
||||
{#if $ae_loc.authenticated_access}
|
||||
{@const file_id =
|
||||
@@ -650,8 +641,6 @@ $effect(() => {
|
||||
return false;
|
||||
}
|
||||
|
||||
// ae_promises[linked_obj.event_file_id] = handle_delete__event_file({event_file_id: linked_obj.event_file_id});
|
||||
|
||||
// First - Attempt to delete the hosted file
|
||||
ae_promises.delete__linked_obj =
|
||||
await core_func
|
||||
|
||||
Reference in New Issue
Block a user