{"record":{"id":"cc028e8727738b32","repo":"chenhg5/cc-connect","slug":"matrix-platform-stopped","errorCode":null,"errorMessage":"matrix: platform stopped","messagePattern":"matrix: platform stopped","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"platform/matrix/matrix.go","lineNumber":133,"sourceCode":"\t\tgroupReplyAll:         groupReplyAll,\n\t\tshareSessionInChannel: shareSession,\n\t\tautoJoin:              autoJoin,\n\t\tproxyURL:              proxyURL,\n\t\tautoVerify:            autoVerify,\n\t\tcrossSigningPassword:  crossSigningPassword,\n\t\thttpClient:            httpClient,\n\t\tdedup:                 core.MessageDedup{},\n\t}, nil\n}\n\nfunc (p *Platform) Name() string { return \"matrix\" }\n\nfunc (p *Platform) Start(handler core.MessageHandler) error {\n\tp.mu.Lock()\n\tdefer p.mu.Unlock()\n\n\tif p.stopping {\n\t\treturn fmt.Errorf(\"matrix: platform stopped\")\n\t}\n\n\tctx, cancel := context.WithCancel(context.Background())\n\tp.handler = handler\n\tp.cancel = cancel\n\n\tgo p.connectLoop(ctx)\n\treturn nil\n}\n\nfunc (p *Platform) SetLifecycleHandler(h core.PlatformLifecycleHandler) {\n\tp.mu.Lock()\n\tdefer p.mu.Unlock()\n\tp.lifecycleHandler = h\n}\n\nfunc (p *Platform) connectLoop(ctx context.Context) {\n\tbackoff := initialBackoff","sourceCodeStart":115,"sourceCodeEnd":151,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/platform/matrix/matrix.go#L115-L151","documentation":"Lifecycle guard in Matrix Platform.Start: the platform's Stop() has already set the stopping flag, so a subsequent Start attempt is rejected to prevent resurrecting a shut-down platform.","triggerScenarios":"Thrown at platform/matrix/matrix.go:133 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Create a new Platform instance instead of restarting a stopped one","Ensure Stop is only called at final shutdown"],"exampleFix":null,"handlingStrategy":"validation","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"}