mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-03-16 21:53:07 +00:00
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 <noreply@anthropic.com>
This commit is contained in:
@@ -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})`
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user