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:
Scott Idem
2026-05-11 12:26:21 -04:00
parent 1ef9080cda
commit 611b1e6b51
11 changed files with 38 additions and 97 deletions

View File

@@ -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