{"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":"Fired in findMatchingChats when the JSON response from the get_chatlist_entries RPC cannot be unmarshalled into []int64 of chat IDs. Indicates the Delta Chat core returned a malformed or unexpected payload shape for a chat-list search, so resolveAliasChatID cannot obtain candidate chat IDs.","triggerScenarios":"Thrown at pkg/channels/deltachat/deltachat.go:799 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check deltachat-rpc-server version compatibility with the expected response shape","Log the raw payload for diagnosis","Treat as an empty result or a clear lookup failure rather than an opaque decode crash"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"49183d7e8daed0dba89ddbb6fcb60089401d9680","analyzedAt":"2026-08-15T21:55:41.315Z","contentChangedAt":"2026-08-15T21:55:41.315Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}