From 44d4b8e04f55c944122ed386bbad56583e793511 Mon Sep 17 00:00:00 2001 From: Scott Idem Date: Tue, 10 Mar 2026 14:22:23 -0400 Subject: [PATCH] IDAA: guard attend_json.zoom against SWR IDB re-fire crash The Zoom button onclick initialises attend_json.zoom. However the background SWR list fetch (load_ae_obj_li__event in +layout.ts) can overwrite $idaa_slct.event_obj with a fresh IDB record where attend_json = {} (no zoom key), even if the Zoom button was already clicked. Without the guard, the $effect that rebuilds the Zoom full URL and the template bindings below the Zoom fields access attend_json.zoom.passcode_enc on an undefined object, throwing a TypeError and crashing the component. Fix: add `&& $idaa_slct.event_obj.attend_json?.zoom` guard to both the $effect condition and the {#if} block that renders the Zoom input fields. --- .../ae_idaa_comp__event_obj_id_edit_v2.svelte | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/routes/idaa/(idaa)/recovery_meetings/ae_idaa_comp__event_obj_id_edit_v2.svelte b/src/routes/idaa/(idaa)/recovery_meetings/ae_idaa_comp__event_obj_id_edit_v2.svelte index 277cca4f..ddcb9911 100644 --- a/src/routes/idaa/(idaa)/recovery_meetings/ae_idaa_comp__event_obj_id_edit_v2.svelte +++ b/src/routes/idaa/(idaa)/recovery_meetings/ae_idaa_comp__event_obj_id_edit_v2.svelte @@ -643,13 +643,19 @@ Copy and paste link: ${ } } - // Rebuild the Zoom full URL whenever Meeting ID, Passcode, Encrypted Passcode, or Domain changes + // Rebuild the Zoom full URL whenever Meeting ID, Passcode, Encrypted Passcode, or Domain changes. + // IMPORTANT: Guard attend_json.zoom before accessing its sub-properties. + // Background SWR re-fires (load_ae_obj_li__event in +layout.ts) can overwrite + // $idaa_slct.event_obj with a fresh IDB record where attend_json = {} (no zoom key), + // even if the Zoom button was already clicked. Without the guard, the access to + // attend_json.zoom.passcode_enc below throws a TypeError and crashes the component. $effect(() => { if ( $idaa_trig == 'update_zoom_full_url' && $idaa_slct.event_obj.attend_url_code && $idaa_slct.event_obj.attend_url_passcode && - $idaa_sess.recovery_meetings.attend_platform === 'Zoom' + $idaa_sess.recovery_meetings.attend_platform === 'Zoom' && + $idaa_slct.event_obj.attend_json?.zoom // guard: zoom may be undefined after IDB re-fire ) { $idaa_trig = null; @@ -1106,8 +1112,12 @@ Copy and paste link: ${ - - {#if $idaa_sess.recovery_meetings.attend_platform === 'Zoom'} + + {#if $idaa_sess.recovery_meetings.attend_platform === 'Zoom' && $idaa_slct.event_obj.attend_json?.zoom}