{"record":{"id":"98cbbc9b3f92e271","repo":"sipeed/picoclaw","slug":"deltachat-get-all-accounts-decode-w","errorCode":null,"errorMessage":"deltachat get_all_accounts decode: %w","messagePattern":"deltachat get_all_accounts decode: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/channels/deltachat/deltachat.go","lineNumber":1241,"sourceCode":"\t}\n\treturn accountConfigString(value)\n}\n\nfunc accountConfigOptionalInt(value int) *string {\n\tif value <= 0 {\n\t\treturn nil\n\t}\n\treturn accountConfigString(strconv.Itoa(value))\n}\n\nfunc (c *DeltaChatChannel) listAccounts(ctx context.Context) ([]dcAccount, error) {\n\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 {","sourceCodeStart":1223,"sourceCodeEnd":1259,"githubUrl":"https://github.com/sipeed/picoclaw/blob/49183d7e8daed0dba89ddbb6fcb60089401d9680/pkg/channels/deltachat/deltachat.go#L1223-L1259","documentation":"The get_all_accounts result did not unmarshal into []dcAccount (id/kind/addr). A schema mismatch: the server returned something other than an array of objects with the expected field types.","triggerScenarios":"json.Unmarshal(raw, &accounts) fails: the server returned an object envelope, a null, or fields with changed casing/types (e.g. id as string).","commonSituations":"Incompatible deltachat-rpc-server major version or a fork changing the accounts payload.","solutions":["Pin the deltachat-rpc-server version known to work with this PicoClaw release","Dump the raw JSON to inspect the actual payload shape","Report/adjust the dcAccount struct if the upstream schema legitimately changed"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"var accounts []dcAccount\nif err := json.Unmarshal(raw, &accounts); err != nil {\n    logger.WarnCF(\"deltachat\", \"unexpected accounts payload\", map[string]any{\"raw\": string(raw)})\n    return nil, fmt.Errorf(\"deltachat get_all_accounts decode: %w\", err)\n}","preventionTips":["Version-pin deltachat-rpc-server in CI and deployment","Capture raw JSON on decode failures to diagnose schema changes fast"],"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"}