{"record":{"id":"590707ff875b3101","repo":"sipeed/picoclaw","slug":"search-contacts-w","errorCode":null,"errorMessage":"search contacts: %w","messagePattern":"search contacts: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/channels/deltachat/deltachat.go","lineNumber":728,"sourceCode":"\tfor _, value := range values {\n\t\tvalue = strings.TrimSpace(value)\n\t\tif value == \"\" {\n\t\t\tcontinue\n\t\t}\n\t\tkey := strings.ToLower(value)\n\t\tif _, ok := seen[key]; ok {\n\t\t\tcontinue\n\t\t}\n\t\tseen[key] = struct{}{}\n\t\tout = append(out, value)\n\t}\n\treturn out\n}\n\nfunc (c *DeltaChatChannel) findMatchingContacts(ctx context.Context, query string) ([]dcContact, error) {\n\traw, err := c.rpc.call(ctx, \"get_contacts\", c.accountID, 0, query)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"search contacts: %w\", err)\n\t}\n\tvar contacts []dcContact\n\tif err := json.Unmarshal(raw, &contacts); err != nil {\n\t\treturn nil, fmt.Errorf(\"search contacts decode: %w\", err)\n\t}\n\tcontacts = uniqueContacts(contacts)\n\tif exact := exactContactMatches(query, contacts); len(exact) > 0 {\n\t\treturn exact, nil\n\t}\n\tif len(contacts) == 1 {\n\t\treturn contacts, nil\n\t}\n\treturn nil, nil\n}\n\nfunc uniqueContacts(contacts []dcContact) []dcContact {\n\tseen := make(map[int64]struct{}, len(contacts))\n\tout := make([]dcContact, 0, len(contacts))","sourceCodeStart":710,"sourceCodeEnd":746,"githubUrl":"https://github.com/sipeed/picoclaw/blob/49183d7e8daed0dba89ddbb6fcb60089401d9680/pkg/channels/deltachat/deltachat.go#L710-L746","documentation":"Error \"search contacts: %w\" thrown in sipeed/picoclaw.","triggerScenarios":"Thrown at pkg/channels/deltachat/deltachat.go:728 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"}