Skip to content

fix: expose temporal connection options and fix error handling in new client - #299

Merged
franklinkim merged 5 commits into
mainfrom
fix/expose-temporal-connection-options-and-fix-error-handling-in-NewClient
Jul 29, 2026
Merged

franklinkim merged 5 commits into
mainfrom
fix/expose-temporal-connection-options-and-fix-error-handling-in-NewClient

Conversation

@franklinkim

Copy link
Copy Markdown
Member

Type of Change

  • New feature
  • Bug fix
  • Documentation update
  • Refactoring
  • Hotfix
  • Security patch

Description

This PR addresses 3 issues:

  1. Older versions of temporal do not support GRPC Compression, which by default is now set to GrpcCompressionGzip. keeltemporal.NewClient() currently doesn't offer a way to configure the ConnectionOptions so this PR adds ClientWithConnectionOptions.

  2. The error handling after nsc.Describe() is currently broken since goerrors.AsAnyType() matches any non-nil error:

import (
	"fmt"
	"testing"

	goerrors "github.com/foomo/go/errors"
	"go.temporal.io/api/serviceerror"
)

func TestAsAnyErr(t *testing.T) {
	err := fmt.Errorf("some unknown error")
	if goerrors.AsAnyType(err, &serviceerror.NotFound{}) {
		t.Fatal("expected goerrors.AsAnyType to not match err to serviceerror.NotFound")
	}
}

This PR fixes that by using std lib errors.As()

  1. If nsc.Describe() failed, but nsc.Register() didn't the code paniced on line 91 because ns is nil. This PR chains the if since there's nothing for nsc.Update() to do if nsc.Register() was called.

Related Issues

none

Checklist

  • My code adheres to the coding and style guidelines of the project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.

@franklinkim franklinkim changed the title Fix/expose temporal connection options and fix error handling in new client fix: expose temporal connection options and fix error handling in new client Jul 29, 2026
@franklinkim
franklinkim merged commit e8ee706 into main Jul 29, 2026
4 checks passed
@franklinkim
franklinkim deleted the fix/expose-temporal-connection-options-and-fix-error-handling-in-NewClient branch July 29, 2026 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants