{"record":{"id":"0f80e4b6c73c314a","repo":"sipeed/picoclaw","slug":"search-chats-decode-w","errorCode":null,"errorMessage":"search chats decode: %w","messagePattern":"search chats decode: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/channels/deltachat/deltachat.go","lineNumber":799,"sourceCode":"\tif local, _, ok := strings.Cut(contact.Address, \"@\"); ok {\n\t\taliases = append(aliases, local, \"@\"+local)\n\t}\n\tfor _, alias := range aliases {\n\t\tif strings.EqualFold(strings.TrimSpace(alias), query) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc (c *DeltaChatChannel) findMatchingChats(ctx context.Context, query string) ([]dcChat, error) {\n\traw, err := c.rpc.call(ctx, \"get_chatlist_entries\", c.accountID, 0, query, nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"search chats: %w\", err)\n\t}\n\tvar chatIDs []int64\n\tif err := json.Unmarshal(raw, &chatIDs); err != nil {\n\t\treturn nil, fmt.Errorf(\"search chats decode: %w\", err)\n\t}\n\tvar chats []dcChat\n\tfor _, chatID := range uniqueInt64s(chatIDs) {\n\t\tif chatID <= 0 {\n\t\t\tcontinue\n\t\t}\n\t\tchat, err := c.getFullChatByContext(ctx, chatID)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif chat.IsDeviceChat {\n\t\t\tcontinue\n\t\t}\n\t\tchats = append(chats, *chat)\n\t}\n\tif exact := exactChatMatches(query, chats); len(exact) > 0 {\n\t\treturn exact, nil\n\t}","sourceCodeStart":781,"sourceCodeEnd":817,"githubUrl":"https://github.com/sipeed/picoclaw/blob/49183d7e8daed0dba89ddbb6fcb60089401d9680/pkg/channels/deltachat/deltachat.go#L781-L817","documentation":"Error \"search chats decode: %w\" thrown in sipeed/picoclaw.","triggerScenarios":"Thrown at pkg/channels/deltachat/deltachat.go:799 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"49183d7e8daed0dba89ddbb6fcb60089401d9680","analyzedAt":"2026-08-15T21:55:41.315Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}