From f5752b662fff3470f5ab79ff0e630f820fc88d41 Mon Sep 17 00:00:00 2001 From: gsxdsm Date: Tue, 3 Mar 2026 20:08:07 -0800 Subject: [PATCH] fix: Allow empty eventHooks/ntfyEndpoints to reconcile from server Remove the `length > 0` guards in fast-hydrate reconciliation that prevented intentional empty-array clears from syncing across clients. Server-side wipe protection (`__allowEmpty*` escape hatches) already ensures empty arrays in the server are intentional. Addresses PR #831 review feedback from CodeRabbit and Gemini. Co-Authored-By: Claude Opus 4.6 --- apps/ui/src/routes/__root.tsx | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/apps/ui/src/routes/__root.tsx b/apps/ui/src/routes/__root.tsx index 403c31e3..379c7b42 100644 --- a/apps/ui/src/routes/__root.tsx +++ b/apps/ui/src/routes/__root.tsx @@ -600,10 +600,7 @@ function RootLayoutContent() { // so updating them won't cause a visible re-render flash. const serverHooks = (finalSettings as GlobalSettings).eventHooks ?? []; const currentHooks = useAppStore.getState().eventHooks; - if ( - JSON.stringify(serverHooks) !== JSON.stringify(currentHooks) && - serverHooks.length > 0 - ) { + if (JSON.stringify(serverHooks) !== JSON.stringify(currentHooks)) { logger.info( `[FAST_HYDRATE] Reconciling eventHooks from server (server=${serverHooks.length}, store=${currentHooks.length})` ); @@ -613,10 +610,7 @@ function RootLayoutContent() { // Reconcile ntfy endpoints from server (same rationale as eventHooks) const serverEndpoints = (finalSettings as GlobalSettings).ntfyEndpoints ?? []; const currentEndpoints = useAppStore.getState().ntfyEndpoints; - if ( - JSON.stringify(serverEndpoints) !== JSON.stringify(currentEndpoints) && - serverEndpoints.length > 0 - ) { + if (JSON.stringify(serverEndpoints) !== JSON.stringify(currentEndpoints)) { logger.info( `[FAST_HYDRATE] Reconciling ntfyEndpoints from server (server=${serverEndpoints.length}, store=${currentEndpoints.length})` );