{"record":{"id":"3abfb08e999108a9","repo":"chenhg5/cc-connect","slug":"s-invalid-preview-handle-type-t","errorCode":null,"errorMessage":"%s: invalid preview handle type %T","messagePattern":"(.+?): invalid preview handle type %T","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"platform/feishu/feishu.go","lineNumber":5268,"sourceCode":"\t\tif errors.Is(err, errFeishuCardRateLimited) {\n\t\t\tslog.Debug(p.tag()+\": stream rich card text rate limited; skipping frame\", \"code\", resp.Code)\n\t\t\treturn nil\n\t\t}\n\t\treturn fmt.Errorf(\"%s: %w\", p.tag(), err)\n\t}\n\treturn nil\n}\n\n// UpdateMessage edits an existing card message identified by previewHandle.\n// Uses the Patch API (HTTP PATCH) which is required for interactive card messages.\nfunc (p *Platform) UpdateMessage(ctx context.Context, previewHandle any, content string) error {\n\tif !p.useInteractiveCard {\n\t\treturn core.ErrNotSupported\n\t}\n\n\th, ok := previewHandle.(*feishuPreviewHandle)\n\tif !ok {\n\t\treturn fmt.Errorf(\"%s: invalid preview handle type %T\", p.tag(), previewHandle)\n\t}\n\n\tcardJSON := \"\"\n\tif isCardJSON(content) {\n\t\t// Card 2.0: engine passes full card JSON directly, skip all processing.\n\t\tcardJSON = content\n\t\th.mu.Lock()\n\t\th.lastContent = content\n\t\th.mu.Unlock()\n\t} else if payload, ok := core.ParseProgressCardPayload(content); ok {\n\t\tcardJSON = buildProgressCardJSONFromPayload(payload)\n\t} else {\n\t\tprocessed := content\n\t\tif containsMarkdown(content) {\n\t\t\tprocessed = preprocessFeishuMarkdown(content)\n\t\t}\n\t\tcardJSON = buildCardJSON(sanitizeMarkdownURLs(processed))\n\t}","sourceCodeStart":5250,"sourceCodeEnd":5286,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/platform/feishu/feishu.go#L5250-L5286","documentation":"UpdateMessage type-guard failure: the previewHandle argument is not a *feishuPreviewHandle, so the card cannot be patched. Reports the unexpected dynamic type; callers must pass the handle returned by SendPreviewStart.","triggerScenarios":"Thrown at platform/feishu/feishu.go:5268 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Only pass handles returned by SendPreviewStart","Check for handles mixed across platform adapters"],"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"}