fix(idaa-recovery-meetings): fix priority sort, stale account_id gate, and cache clear

Three fixes for the IDAA Recovery Meetings load/display issues:

1. Sort direction: events use legacy encoding (priority ? 1 : 0), not build_tmp_sort.
   priority=true→'1' requires DESCENDING sort to put priority items first. The prior
   commit (ee79e33a2) incorrectly applied the build_tmp_sort-compatible ASC comparator
   to the events module, which does not use that encoding. Reverted in +page.svelte
   (both fast-path and API-results sort) and ae_idaa_comp__event_obj_li_wrapper.svelte.

2. Stale account_id gate: search $effect and handle_search_refresh now read
   $slct.account_id (set only by the bootstrap Sync Effect, reliable) instead of
   $ae_loc.account_id (persisted localStorage, may be stale from a prior session).
   Follows the mistake #14 pattern from BOOTSTRAP__AI_Agent_Quickstart.md.

3. Clear Cache & Reload: now enumerates and deletes ALL IDB databases via
   indexedDB.databases() (not just db_events.event), clears all localStorage and
   sessionStorage (not just two keys), and preserves the iframe reload URL for
   Novi re-authentication — matching the Full Reset pattern in e_app_help_tech.svelte.

4. IDB version bump: events.event → v3 (precautionary; flushes any stale cached
   event records on next user load in case prior deploys missed a bump).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Scott Idem
2026-06-03 17:54:05 -04:00
parent 74e0f752a6
commit a4fed750fa
3 changed files with 36 additions and 23 deletions

View File

@@ -86,7 +86,7 @@ export const IDB_CONTENT_VERSIONS = {
journal_entry: 3 // 2026-05-14: removed content_md_html + history_md_html from properties_to_save
},
events: {
event: 2, // Bumped 2026-05-16: force-clear stale IDB data causing "no meetings found" on IDAA
event: 3, // Bumped 2026-06-03: precautionary clear after sort-direction and account_id gate fixes
event_session: 1,
event_presenter: 1,
event_badge: 1,