From 14e84884cd99d8122b0d90b89ff3df9a5335a60e Mon Sep 17 00:00:00 2001 From: Scott Idem Date: Tue, 19 May 2026 15:53:18 -0400 Subject: [PATCH] =?UTF-8?q?refactor(idaa):=20rename=20reload=5Fto=5Forigin?= =?UTF-8?q?=20=E2=86=92=20reload=5Fwith=5Fuuid=20(clearer=20intent)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 'origin' is a reserved web term (protocol+domain); the function restores the initial Novi-provided iframe URL (which includes the ?uuid= param), not the site root. Renamed to reload_with_uuid to make that clear. Co-Authored-By: Claude Sonnet 4.6 --- src/routes/idaa/(idaa)/+layout.svelte | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/routes/idaa/(idaa)/+layout.svelte b/src/routes/idaa/(idaa)/+layout.svelte index 9a2d8485..198c92e3 100644 --- a/src/routes/idaa/(idaa)/+layout.svelte +++ b/src/routes/idaa/(idaa)/+layout.svelte @@ -88,10 +88,10 @@ onMount(() => { } }); -function reload_to_origin() { - const origin_url = sessionStorage.getItem(IDAA_IFRAME_RELOAD_URL_KEY); - if (origin_url && origin_url !== location.href) { - location.href = origin_url; +function reload_with_uuid() { + const initial_url = sessionStorage.getItem(IDAA_IFRAME_RELOAD_URL_KEY); + if (initial_url && initial_url !== location.href) { + location.href = initial_url; } else { location.reload(); } @@ -498,7 +498,7 @@ function handle_verify_retry() { db_archives.archive.clear().catch(() => {}); db_archives.content.clear().catch(() => {}); db_events.event.clear().catch(() => {}); - reload_to_origin(); + reload_with_uuid(); }}> Reset & Retry @@ -550,7 +550,7 @@ function handle_verify_retry() { db_archives.archive.clear().catch(() => {}); db_archives.content.clear().catch(() => {}); db_events.event.clear().catch(() => {}); - reload_to_origin(); + reload_with_uuid(); }} class="btn btn-sm preset-tonal-surface preset-outlined-warning-100-900 hover:preset-filled-warning-200-800 transition-all"> @@ -567,7 +567,7 @@ function handle_verify_retry() { } localStorage.clear(); sessionStorage.clear(); - // sessionStorage was just cleared, so reload_to_origin() falls back to + // sessionStorage was just cleared, so reload_with_uuid() falls back to // location.reload() — that's correct since this is a full wipe. location.reload(); }} @@ -613,7 +613,7 @@ function handle_verify_retry() { (2) Timing race on first load — UUID arrives but $ae_loc not yet populated. (3) $ae_loc reset while $idaa_loc TTL cache was still valid (fixed via TTL+perms check). In iframe context the UUID is only on the initial Novi-provided URL, not on - subsequent SvelteKit client-side navigations — reload_to_origin() restores it. --> + subsequent SvelteKit client-side navigations — reload_with_uuid() restores it. -->

@@ -632,13 +632,13 @@ function handle_verify_retry() {

@@ -651,7 +651,7 @@ function handle_verify_retry() { db_archives.archive.clear().catch(() => {}); db_archives.content.clear().catch(() => {}); db_events.event.clear().catch(() => {}); - reload_to_origin(); + reload_with_uuid(); }} class="btn btn-sm preset-tonal-surface preset-outlined-warning-100-900 hover:preset-filled-warning-200-800 transition-all">