sipeed/picoclaw · error

get chat by contact: %w

Error message

get chat by contact: %w

What it means

Error "get chat by contact: %w" thrown in sipeed/picoclaw.

Source

Thrown at pkg/channels/deltachat/deltachat.go:631

	}
	raw, err := c.rpc.call(ctx, "create_contact", c.accountID, address, displayName)
	if err != nil {
		return 0, fmt.Errorf("create contact: %w", err)
	}
	var contactID int64
	if err := json.Unmarshal(raw, &contactID); err != nil {
		return 0, fmt.Errorf("create contact decode: %w", err)
	}
	if contactID <= 0 {
		return 0, fmt.Errorf("create contact returned empty id: %w", channels.ErrSendFailed)
	}
	return contactID, nil
}

func (c *DeltaChatChannel) chatIDForContact(ctx context.Context, contactID int64) (int64, error) {
	raw, err := c.rpc.call(ctx, "get_chat_id_by_contact_id", c.accountID, contactID)
	if err != nil {
		return 0, fmt.Errorf("get chat by contact: %w", err)
	}
	chatID, err := decodeOptionalInt64(raw, "get chat by contact")
	if err != nil {
		return 0, err
	}
	if chatID > 0 {
		return chatID, nil
	}

	raw, err = c.rpc.call(ctx, "create_chat_by_contact_id", c.accountID, contactID)
	if err != nil {
		return 0, fmt.Errorf("create chat by contact: %w", err)
	}
	if err := json.Unmarshal(raw, &chatID); err != nil {
		return 0, fmt.Errorf("create chat by contact decode: %w", err)
	}
	if chatID <= 0 {
		return 0, fmt.Errorf("create chat by contact returned empty id: %w", channels.ErrSendFailed)

View on GitHub (pinned to 49183d7e8d)

When it happens

Trigger: Thrown at pkg/channels/deltachat/deltachat.go:631 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of sipeed/picoclaw@49183d7e8d (2026-08-15). Data as JSON: /api/errors/0ca4cc6e740955d6. Report an issue: GitHub.