API Hardening: Refine Bypass Logic and Enable Permissive Mode
- Hardened 'Bootstrap Paradox' bypass logic in GET/POST helpers to only strip account ID if an intentional bypass value is provided. - Enabled 'Permissive Update Mode' (x-ae-ignore-extra-fields: true) by default to improve frontend state synchronization. - Fixed loader hydration bug where isolated API headers were being overwritten by stale global defaults. - Ensured correctly resolved account names persist in local state instead of defaulting to 'Ghost Account'. - Added Environment & Bridge diagnostics section to the testing dashboard for easier runtime verification.
This commit is contained in:
@@ -28,7 +28,8 @@
|
||||
ArrowRightLeft,
|
||||
Code,
|
||||
FlaskConical,
|
||||
Info
|
||||
Info,
|
||||
Satellite
|
||||
} from 'lucide-svelte';
|
||||
|
||||
// Core Module Imports
|
||||
@@ -36,6 +37,7 @@
|
||||
import { lookup_site_domain_v3 } from '$lib/ae_core/ae_core__site';
|
||||
import { load_ae_obj_id__user } from '$lib/ae_core/ae_core__user';
|
||||
import { db_core } from '$lib/ae_core/db_core';
|
||||
import { events_loc } from '$lib/stores/ae_events_stores';
|
||||
|
||||
// State Variables
|
||||
let test_result: any = $state(null);
|
||||
@@ -174,6 +176,10 @@
|
||||
return await response.json();
|
||||
});
|
||||
|
||||
// Environment Diagnostics
|
||||
let is_native = $derived(typeof window !== 'undefined' && !!(window as any).native_app);
|
||||
let app_mode = $derived($events_loc?.launcher?.app_mode || 'web');
|
||||
|
||||
</script>
|
||||
|
||||
<!-- Outer wrapper to enable scrolling if parent is overflow-hidden -->
|
||||
@@ -208,6 +214,36 @@
|
||||
<div class="grid grid-cols-1 xl:grid-cols-[1fr_400px] gap-8">
|
||||
<main class="space-y-6">
|
||||
|
||||
<!-- Environment & Bridge Card -->
|
||||
<div class="card p-6 variant-soft-tertiary space-y-4 border border-gray-500 shadow-lg">
|
||||
<header class="flex justify-between items-center border-b border-gray-500 pb-3">
|
||||
<div class="flex items-center gap-2 text-tertiary-700 dark:text-tertiary-300">
|
||||
<Satellite size={20} />
|
||||
<h3 class="h3 font-bold">Environment & Bridge Diagnostics</h3>
|
||||
</div>
|
||||
<span class="badge variant-filled-tertiary font-mono p-2 uppercase">
|
||||
Runtime: {is_native ? 'Electron' : 'Web Browser'}
|
||||
</span>
|
||||
</header>
|
||||
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
|
||||
<div class="flex flex-col p-3 bg-gray-500/10 rounded" title="The current logic mode of the application (e.g. native, onsite, web).">
|
||||
<span class="text-[10px] uppercase opacity-50 font-bold">App Mode</span>
|
||||
<span class="text-sm font-bold text-tertiary-600 dark:text-tertiary-400 uppercase tracking-widest">{app_mode}</span>
|
||||
</div>
|
||||
<div class="flex flex-col p-3 bg-gray-500/10 rounded" title="Presence of window.native_app bridge object.">
|
||||
<span class="text-[10px] uppercase opacity-50 font-bold">Bridge Detected</span>
|
||||
<div class="flex items-center gap-2">
|
||||
<div class="w-2 h-2 rounded-full {is_native ? 'bg-success-500 animate-pulse' : 'bg-surface-500'}"></div>
|
||||
<span class="text-sm font-semibold">{is_native ? 'Active' : 'Missing / Inactive'}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-col p-3 bg-gray-500/10 rounded" title="The host string being used for bootstrap site resolution.">
|
||||
<span class="text-[10px] uppercase opacity-50 font-bold">Bootstrap Host</span>
|
||||
<span class="font-mono text-xs truncate">{$ae_loc.hostname || '--'}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Session Context Card -->
|
||||
<div class="card p-6 variant-soft-surface space-y-4 border border-gray-500 shadow-lg">
|
||||
<header class="flex justify-between items-center border-b border-gray-500 pb-3">
|
||||
|
||||
Reference in New Issue
Block a user