fix(idaa): exempt trusted_access users from IDB purge and BB load gate
Case 1 purge in the layout was firing for manager/trusted users (no UUID), causing a loop: db_events.event cleared → liveQuery updates → refetch → store write → Effect 2 re-runs → clear again. BB $effect was also blocking managers since novi_verified is always false for non-Novi auth paths. Both now check trusted_access before gating/purging. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -148,7 +148,13 @@ $effect(() => {
|
||||
novi_verifying = false;
|
||||
return;
|
||||
}
|
||||
// Case 1: no UUID, no cached session — non-Novi path, deny normally.
|
||||
// Case 3: no UUID, no cached Novi session, but user has trusted/manager access.
|
||||
// They are legitimately authenticated via a non-Novi path — do NOT purge.
|
||||
if ($ae_loc.trusted_access) {
|
||||
novi_verifying = false;
|
||||
return;
|
||||
}
|
||||
// Case 1: no UUID, no cached session, no elevated access — anonymous user.
|
||||
// Purge any IDAA data that may have been cached from a previous session.
|
||||
$idaa_loc.novi_verified = false;
|
||||
novi_verifying = false;
|
||||
|
||||
@@ -119,7 +119,7 @@ let lq__post_obj_li = $derived.by(() => {
|
||||
// link prefetch (hover), causing private IDAA data to be written to IDB before auth runs.
|
||||
// $effect only runs post-mount, after the layout has completed Novi verification.
|
||||
$effect(() => {
|
||||
if (!$idaa_loc.novi_verified) return;
|
||||
if (!$idaa_loc.novi_verified && !$ae_loc.trusted_access) return;
|
||||
untrack(() => {
|
||||
posts_func.load_ae_obj_li__post({
|
||||
api_cfg: $ae_api,
|
||||
|
||||
Reference in New Issue
Block a user