sipeed/picoclaw · error

get chat

Error message

get chat %d: %w

What it means

Wraps a failure of the 'get_full_chat_by_id' RPC in getFullChatByContext for the given chatID. Fires when the transport fails or the core rejects the chat ID (e.g. unknown or deleted chat) during recipient resolution.

Solutions

  1. Validate the chatID before calling; a stale ID may have been removed from the core
  2. Retry the call for transient RPC errors
  3. Return a clear 'chat not found' style error to the alias-resolution path
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at pkg/channels/deltachat/deltachat.go:850 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/f9ead7b05552a7cc. Report an issue: GitHub.

Appendix: source

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

		out = append(out, value)
	}
	return out
}

func exactChatMatches(query string, chats []dcChat) []dcChat {
	var matches []dcChat
	for _, chat := range chats {
		if strings.EqualFold(strings.TrimSpace(chat.Name), strings.TrimSpace(query)) {
			matches = append(matches, chat)
		}
	}
	return matches
}

func (c *DeltaChatChannel) getFullChatByContext(ctx context.Context, chatID int64) (*dcChat, error) {
	raw, err := c.rpc.call(ctx, "get_full_chat_by_id", c.accountID, chatID)
	if err != nil {
		return nil, fmt.Errorf("get chat %d: %w", chatID, err)
	}
	var chat dcChat
	if err := json.Unmarshal(raw, &chat); err != nil {
		return nil, fmt.Errorf("get chat %d decode: %w", chatID, err)
	}
	return &chat, nil
}

func ambiguousRecipientError(target string, labels []string) error {
	return fmt.Errorf(
		"ambiguous recipient %q matches %s: %w",
		target,
		strings.Join(labels, ", "),
		channels.ErrSendFailed,
	)
}

func contactRecipientLabels(contacts []dcContact) []string {

View on GitHub (pinned to 49183d7e8d)