Description
useMcpServerCRUD uses a hook-based useMessage API from @arco-design/web-react to show toast notifications. When the parent component unmounts during an async MCP operation (toggle, delete, edit), the internal contextHolderRef.current becomes null, causing:
TypeError: Cannot read properties of null (reading 'addInstance')
Context
- Sentry issue: ELECTRON-D (29 occurrences, last seen 2026-03-26)
- Stack trace:
useMcpServerCRUD.ts:233 → useMessage.js:53 → contextHolderRef.current.addInstance
- The static
Message API is lifecycle-independent and safe to call after unmount