{"record":{"id":"f17f9d2e35170951","repo":"chenhg5/cc-connect","slug":"matrix-invalid-preview-handle-type-t","errorCode":null,"errorMessage":"matrix: invalid preview handle type %T","messagePattern":"matrix: invalid preview handle type %T","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"platform/matrix/matrix.go","lineNumber":589,"sourceCode":"\t\t\tcase <-ctx.Done():\n\t\t\t\treturn\n\t\t\tcase <-ticker.C:\n\t\t\t\tc := p.getClient()\n\t\t\t\tif c == nil {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\t_, _ = c.UserTyping(ctx, rc.roomID, true, 30*time.Second)\n\t\t\t}\n\t\t}\n\t}()\n\n\treturn func() { close(done) }\n}\n\nfunc (p *Platform) UpdateMessage(ctx context.Context, previewHandle any, content string) error {\n\trc, ok := previewHandle.(replyContext)\n\tif !ok {\n\t\treturn fmt.Errorf(\"matrix: invalid preview handle type %T\", previewHandle)\n\t}\n\n\tparsed := format.RenderMarkdown(content, true, false)\n\tparsed.Body = content\n\n\t// Copy the new content for m.replace relation\n\tnewContent := parsed\n\tnewContent.Mentions = nil\n\n\tparsed.NewContent = &newContent\n\tparsed.RelatesTo = &event.RelatesTo{\n\t\tType:    event.RelReplace,\n\t\tEventID: rc.messageID,\n\t}\n\tparsed.Body = \"* \" + content\n\n\treturn p.sendRoomEvent(ctx, rc.roomID, event.EventMessage, &parsed)\n}","sourceCodeStart":571,"sourceCodeEnd":607,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/platform/matrix/matrix.go#L571-L607","documentation":"Type-assertion guard in Matrix UpdateMessage: the previewHandle is not the platform's internal replyContext struct, meaning the streaming-preview handle was not created by this platform's preview mechanism.","triggerScenarios":"Thrown at platform/matrix/matrix.go:589 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Only pass handles returned by this platform's send path"],"exampleFix":null,"handlingStrategy":"type-guard","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"}