{"record":{"id":"edee7b4a45da6d81","repo":"sipeed/picoclaw","slug":"deltachat-is-configured-decode-w","errorCode":null,"errorMessage":"deltachat is_configured decode: %w","messagePattern":"deltachat is_configured decode: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/channels/deltachat/deltachat.go","lineNumber":1253,"sourceCode":"\traw, err := c.rpc.call(ctx, \"get_all_accounts\")\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"deltachat get_all_accounts: %w\", err)\n\t}\n\tvar accounts []dcAccount\n\tif err := json.Unmarshal(raw, &accounts); err != nil {\n\t\treturn nil, fmt.Errorf(\"deltachat get_all_accounts decode: %w\", err)\n\t}\n\treturn accounts, nil\n}\n\nfunc (c *DeltaChatChannel) isConfigured(ctx context.Context, accountID int64) (bool, error) {\n\traw, err := c.rpc.call(ctx, \"is_configured\", accountID)\n\tif err != nil {\n\t\treturn false, fmt.Errorf(\"deltachat is_configured: %w\", err)\n\t}\n\tvar ok bool\n\tif err := json.Unmarshal(raw, &ok); err != nil {\n\t\treturn false, fmt.Errorf(\"deltachat is_configured decode: %w\", err)\n\t}\n\treturn ok, nil\n}\n\n// joinInviteLink optionally joins a chat via a configured invite/QR link.\nfunc (c *DeltaChatChannel) joinInviteLink(ctx context.Context) error {\n\tlink := strings.TrimSpace(c.config.InviteLink)\n\tif link == \"\" {\n\t\treturn nil\n\t}\n\tchatRaw, err := c.rpc.call(ctx, \"secure_join\", c.accountID, link)\n\tif err != nil {\n\t\treturn err\n\t}\n\tvar chatID int64\n\tif err := json.Unmarshal(chatRaw, &chatID); err == nil && chatID > 0 {\n\t\t_, _ = c.rpc.call(ctx, \"accept_chat\", c.accountID, chatID)\n\t\tlogger.InfoCF(\"deltachat\", \"Joined invite chat\", map[string]any{\"chat_id\": chatID})","sourceCodeStart":1235,"sourceCodeEnd":1271,"githubUrl":"https://github.com/sipeed/picoclaw/blob/49183d7e8daed0dba89ddbb6fcb60089401d9680/pkg/channels/deltachat/deltachat.go#L1235-L1271","documentation":"The is_configured result did not unmarshal into a JSON bool: the server returned 'true' as a string, a number, or another non-boolean shape. Pure schema mismatch, not an account state.","triggerScenarios":"json.Unmarshal(raw, &ok) fails on a non-boolean result payload.","commonSituations":"Version skew or a custom deltachat-rpc-server build encoding booleans differently.","solutions":["Pin a compatible deltachat-rpc-server version","Log the raw payload to confirm the shape","Report upstream if a stock server produces it"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"var ok bool\nif err := json.Unmarshal(raw, &ok); err != nil {\n    logger.WarnCF(\"deltachat\", \"unexpected is_configured payload\", map[string]any{\"raw\": string(raw)})\n    return false, fmt.Errorf(\"deltachat is_configured decode: %w\", err)\n}","preventionTips":["Pin the deltachat-rpc-server version to keep boolean result encoding stable","Log raw payloads for any decode failure to spot version skew immediately"],"tags":["deltachat","rpc","json","version-skew","go"],"backgroundTag":null,"analyzedSha":"49183d7e8daed0dba89ddbb6fcb60089401d9680","analyzedAt":"2026-08-15T21:55:41.315Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}