Patch Changes
-
#611
f20f6e7Thanks @eddiechan! - Guard receivers against late mutations on detached nodesRemoteReceiverandSignalRemoteReceivernow dropinsertChild,removeChild,updateProperty, andupdateTextmutations whose target node is no longer in the receiver'sattachedmap, instead of throwing aTypeErrorwhile dereferencing the missing node.This race surfaces in production as unhandled promise rejections such as
TypeError: undefined is not an object (evaluating 'x.properties')(Safari) /TypeError: Cannot read properties of undefined (reading 'properties')(V8) when a remote sender dispatches a mutation for a node whose host-side state has just been removed (for example, aremoveChildfor an ancestor was processed earlier in the same batch, or arrived first from a separate batched payload).PR #533 previously added a similar guard to
removeChildfor the case where the child slot at a given index was empty, but did not handle the case where the parent itself was missing, and did not touchupdatePropertyorupdateText. This change applies the same defensive pattern uniformly to every connection callback that dereferencesattached.get(id).Late mutations targeting a detached subtree are by definition no-ops — there is nothing left to mutate.
-
Updated dependencies [
f20f6e7]:- @remote-dom/core@1.11.1