{"record":{"id":"47ba2e3c0783387d","repo":"chenhg5/cc-connect","slug":"matrix-not-connected","errorCode":null,"errorMessage":"matrix: not connected","messagePattern":"matrix: not connected","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"platform/matrix/matrix.go","lineNumber":388,"sourceCode":"\t\t} else {\n\t\t\tslog.Info(\"matrix: auto-joined room\", \"room\", evt.RoomID)\n\t\t}\n\t}\n}\n\nfunc (p *Platform) dispatch(msg *core.Message) {\n\thandler := p.getHandler()\n\tif handler == nil {\n\t\treturn\n\t}\n\thandler(p, msg)\n}\n\n// sendRoomEvent sends an event to a room, encrypting it if E2EE is available and the room is encrypted.\nfunc (p *Platform) sendRoomEvent(ctx context.Context, roomID id.RoomID, evtType event.Type, content any) error {\n\tclient := p.getClient()\n\tif client == nil {\n\t\treturn fmt.Errorf(\"matrix: not connected\")\n\t}\n\n\t// Try E2EE path first (only available when built with goolm tag)\n\tif handled, err := p.tryEncryptAndSend(ctx, client, roomID, evtType, content); handled {\n\t\treturn err\n\t}\n\n\t_, err := client.SendMessageEvent(ctx, roomID, evtType, content)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"matrix: send: %w\", err)\n\t}\n\treturn nil\n}\n\nfunc (p *Platform) Reply(ctx context.Context, rctx any, content string) error {\n\trc, ok := rctx.(replyContext)\n\tif !ok {\n\t\treturn fmt.Errorf(\"matrix: invalid reply context type %T\", rctx)","sourceCodeStart":370,"sourceCodeEnd":406,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/platform/matrix/matrix.go#L370-L406","documentation":"sendRoomEvent guard: no live client is cached for the current generation, so events cannot be sent until the sync loop reconnects; Reply/Send/SendImage/SendFile/UpdateMessage all funnel through this check.","triggerScenarios":"Thrown at platform/matrix/matrix.go:388 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry after connectLoop restores the client","Check network to the homeserver if it stays disconnected"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4000b2338aa6e850c99df54f8b0ed6ed7460b401","analyzedAt":"2026-09-06T11:45:09.575Z","contentChangedAt":"2026-09-06T11:45:09.575Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}