fix(standardization): enforce V3 String-Only ID mapping and harden account isolation
- Added 'account_id_random' to persistent property list to fix local search isolation. - Standardized search body and helpers to support mandatory x-account-id headers. - Refactored LiveQuery to use synchronous dependency tracking ($derived.by) for reliable search updates. - Broadened server-side search to handle inclusive OR logic on the client, preventing disappearing results. - Updated task list with IDAA Recovery Meeting testing status.
This commit is contained in:
@@ -42,7 +42,7 @@ export async function load({ params, parent }) {
|
||||
qry_conference: false, // IDAA Recovery Meetings are not standard conferences
|
||||
enabled: 'enabled',
|
||||
hidden: 'not_hidden',
|
||||
limit: 199,
|
||||
limit: 499,
|
||||
order_by_li: {
|
||||
priority: 'DESC',
|
||||
sort: 'DESC',
|
||||
|
||||
@@ -42,18 +42,15 @@
|
||||
/**
|
||||
* Stable LiveQuery Pattern (Aether UI V3)
|
||||
*
|
||||
* WHY: We wrap liveQuery in $derived to ensure that Svelte recreates the
|
||||
* Dexie observable whenever the input props (event_id_random_li) change.
|
||||
*
|
||||
* TWO SCENARIOS:
|
||||
* 1. Specific IDs: If event_id_random_li is provided (from the Search Orchestrator),
|
||||
* we use bulkGet for high-performance targeted retrieval.
|
||||
* 2. Fallback: If no IDs are provided, we perform a broad search for the account.
|
||||
* WHY: We use $derived.by to synchronously track the 'event_id_random_li' prop.
|
||||
* This ensures that whenever the parent search logic updates the ID list,
|
||||
* Svelte recreates this Dexie observable and triggers a fresh UI render.
|
||||
*/
|
||||
let lq__event_obj_li = $derived(
|
||||
liveQuery(async () => {
|
||||
const ids = event_id_random_li;
|
||||
|
||||
let lq__event_obj_li = $derived.by(() => {
|
||||
// SVELTE 5 REACTIVITY: Track IDs synchronously
|
||||
const ids = event_id_random_li;
|
||||
|
||||
return liveQuery(async () => {
|
||||
// SCENARIO 1: Specific IDs provided (from Search Fast Path or API)
|
||||
if (Array.isArray(ids)) {
|
||||
if (ids.length > 0) {
|
||||
@@ -72,7 +69,7 @@
|
||||
if (log_lvl) console.log(`Wrapper LQ: Fallback search for ${link_to_type}: ${link_to_id}`);
|
||||
const base_query = db_events.event
|
||||
.where(dq__where_type_id_val)
|
||||
.equals(dq__where_eq_id_val);
|
||||
.equals(link_to_id);
|
||||
|
||||
if (order_by == 'name') {
|
||||
return await base_query
|
||||
@@ -87,8 +84,8 @@
|
||||
}
|
||||
}
|
||||
return null;
|
||||
})
|
||||
);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
{#if $lq__event_obj_li}
|
||||
|
||||
Reference in New Issue
Block a user