chenhg5/cc-connect · error

matrix: not connected

Error message

matrix: not connected

What it means

sendRoomEvent guard: no live client is cached for the current generation, so events cannot be sent until the sync loop reconnects; Reply/Send/SendImage/SendFile/UpdateMessage all funnel through this check.

Source

Thrown at platform/matrix/matrix.go:388

		} else {
			slog.Info("matrix: auto-joined room", "room", evt.RoomID)
		}
	}
}

func (p *Platform) dispatch(msg *core.Message) {
	handler := p.getHandler()
	if handler == nil {
		return
	}
	handler(p, msg)
}

// sendRoomEvent sends an event to a room, encrypting it if E2EE is available and the room is encrypted.
func (p *Platform) sendRoomEvent(ctx context.Context, roomID id.RoomID, evtType event.Type, content any) error {
	client := p.getClient()
	if client == nil {
		return fmt.Errorf("matrix: not connected")
	}

	// Try E2EE path first (only available when built with goolm tag)
	if handled, err := p.tryEncryptAndSend(ctx, client, roomID, evtType, content); handled {
		return err
	}

	_, err := client.SendMessageEvent(ctx, roomID, evtType, content)
	if err != nil {
		return fmt.Errorf("matrix: send: %w", err)
	}
	return nil
}

func (p *Platform) Reply(ctx context.Context, rctx any, content string) error {
	rc, ok := rctx.(replyContext)
	if !ok {
		return fmt.Errorf("matrix: invalid reply context type %T", rctx)

View on GitHub (pinned to 4000b2338a)

Solutions

  1. Retry after connectLoop restores the client
  2. Check network to the homeserver if it stays disconnected
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at platform/matrix/matrix.go:388 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of chenhg5/cc-connect@4000b2338a (2026-09-06). Data as JSON: /api/errors/47ba2e3c0783387d. Report an issue: GitHub.