From e5b94123a597c4c6102bb7b33c3bbd3c22c25ff6 Mon Sep 17 00:00:00 2001 From: Scott Idem Date: Thu, 19 Feb 2026 15:19:19 -0500 Subject: [PATCH] Fixed Event File data mapping for V3 API and updated AGENT_TODO. Mapped prefixed backend fields 'hosted_file_hash_sha256' and 'hosted_file_size' to flat 'hash_sha256' and 'file_size' properties in the Event File data layer. This resolves component crashes (TypeError: slice on null) by ensuring IndexedDB is populated with valid hash strings. Updated AGENT_TODO.md to reflect recently completed tasks. --- documentation/AGENT_TODO.md | 4 ++-- src/lib/ae_events/ae_events__event_file.ts | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/documentation/AGENT_TODO.md b/documentation/AGENT_TODO.md index b2dd3ca8..07c37fe8 100644 --- a/documentation/AGENT_TODO.md +++ b/documentation/AGENT_TODO.md @@ -8,12 +8,12 @@ - [ ] **Step 3:** Implement formal error boundaries for 403/401 API responses to provide user-friendly "Session Expired" or "Access Denied" UI. ## 🚧 Upcoming High Priority -- **event_session Search Fix:** Investigate 400 error (`Unauthorized search field 'account_id'`) on `event_session/search`. -- **Badge Rendering Fix:** Refactor `badge_template` lookup to use V3 Triple ID pattern. - **CRUD v2 Refactor:** Finalize retirement of `Element_ae_crud_v2.svelte` in favor of V3 Editor. - **Temp Cleanup:** Auto-removal of native `.tmp` files older than 24h. ## ✅ Completed Recently +- [x] **[UI]** **Badge Rendering Fix:** Refactored `badge_template` lookup to use V3 Triple ID pattern. +- [x] **[API]** **event_session Search Fix:** Resolved 400 error (`Unauthorized search field 'account_id'`) via backend update. - [x] **[Security]** Purged redundant `x-aether-api-token` from frontend and notified backend. - [x] **[Security]** Fixed misplaced `Access-Control-Allow-Origin` request headers. - [x] **[Security]** Implemented "Account ID Scavenging" to fix hydration race conditions. diff --git a/src/lib/ae_events/ae_events__event_file.ts b/src/lib/ae_events/ae_events__event_file.ts index 826eeaa5..0eeea2a3 100644 --- a/src/lib/ae_events/ae_events__event_file.ts +++ b/src/lib/ae_events/ae_events__event_file.ts @@ -555,6 +555,14 @@ export async function process_ae_obj__event_file_props({ obj_type: 'event_file', log_lvl, specific_processor: (obj) => { + // SYNC: Map prefixed Hosted File fields to flat names for UI consistency + if (obj.hosted_file_hash_sha256 && !obj.hash_sha256) { + obj.hash_sha256 = obj.hosted_file_hash_sha256; + } + if (obj.hosted_file_size && !obj.file_size) { + obj.file_size = obj.hosted_file_size; + } + // SYNC: Ensure for_id matches the specific object ID it was linked to if (obj.for_type && !obj.for_id) { const specific_id_key = `${obj.for_type}_id`;