mirror of
https://github.com/meshtastic/web.git
synced 2026-08-02 16:09:19 -04:00
Now that the SDK NodesClient owns public-key validation and per-node error tracking, the legacy Zustand mirrors are dead code. packages/web/src/core/stores/nodeDBStore/index.ts - Drops the nodeErrors map + setNodeError / getNodeError / hasNodeError / clearNodeError / removeAllNodeErrors methods from the NodeDB interface and factory. - Drops the validateIncomingNode call inside addNode and inside setNodeNum's merge path; legacy mirror is now a straight last-write- wins shallow merge. The SDK runs validation independently against its own snapshot. - Drops the nodeErrors entries from the persisted partialize shape. packages/web/src/core/stores/nodeDBStore/types.ts - Removes NodeError + NodeErrorType. ProcessPacketParams stays. packages/web/src/core/stores/nodeDBStore/nodeValidation.ts — deleted (SDK ports it at packages/sdk/src/features/nodes/infrastructure/ nodeValidation.ts and exposes the verdict via NodesClient). packages/web/src/core/stores/index.ts — drop the dead NodeErrorType re-export. packages/web/src/core/stores/nodeDBStore/nodeDBStore.test.tsx - Removes tests covering the migrated PKI behaviour (errors map, MISMATCH, DUPLICATE, "unions nodeErrors") — equivalent coverage now lives in packages/sdk/src/features/nodes/NodesClient.errors.test.ts. - Trims the surviving merge-semantics tests to the simpler last-write- wins shape. - The "selector re-renders" test swaps the deleted setNodeError mutation for an updateFavorite call to keep the slice-stability assertion alive. - The "addNodeDB instance identity" assertion relaxes from .toBe to content equality — immer's pruneStaleNodes path can reseat the entry, but the registered DB's id stays stable. components/Dialog/ResetNodeDbDialog/ResetNodeDbDialog.tsx — calls meshClient.nodes.clearAllErrors() instead of the legacy removeAllNodeErrors. Test mocks updated. components/Dialog/RefreshKeysDialog/* — already migrated to SDK errors in the previous commit; no further changes here. Test counts: web 290 (was 295 — 5 PKI-tracking tests retired in favour of 5 equivalent SDK tests). Production Vite build clean.