Description
When checking out dev after the PR merges for Phase 3 Wake Substrate, the Memory Core MCP server fails to boot with the following exception:
TypeError: Cannot read properties of null (reading 'storage')
at WakeSubscriptionService.setMcpServer (WakeSubscriptionService.mjs:93:41)
at Server.initAsync (Server.mjs:94:33)Root Cause
In Server.mjs, WakeSubscriptionService.setMcpServer(this.mcpServer) is called synchronously before SessionService and GraphService have awaited their .ready() initialization. Because GraphService.db is not populated until its initAsync completes, GraphService.db is null when setMcpServer attempts to read GraphService.db.storage to anchor the liveCursor.
Proposed Fix
Make WakeSubscriptionService.setMcpServer asynchronous, and add await GraphService.ready(); within it to ensure the database object is fully populated before querying the max log_id. Update Server.mjs to await WakeSubscriptionService.setMcpServer(this.mcpServer);.
Description When checking out
devafter the PR merges for Phase 3 Wake Substrate, the Memory Core MCP server fails to boot with the following exception:TypeError: Cannot read properties of null (reading 'storage') at WakeSubscriptionService.setMcpServer (WakeSubscriptionService.mjs:93:41) at Server.initAsync (Server.mjs:94:33)Root Cause In
Server.mjs,WakeSubscriptionService.setMcpServer(this.mcpServer)is called synchronously beforeSessionServiceandGraphServicehave awaited their.ready()initialization. BecauseGraphService.dbis not populated until itsinitAsynccompletes,GraphService.dbisnullwhensetMcpServerattempts to readGraphService.db.storageto anchor theliveCursor.Proposed Fix Make
WakeSubscriptionService.setMcpServerasynchronous, and addawait GraphService.ready();within it to ensure the database object is fully populated before querying the maxlog_id. UpdateServer.mjstoawait WakeSubscriptionService.setMcpServer(this.mcpServer);.