From dfd3923ce388317f8da5bb28ed5663d8f7304a1f Mon Sep 17 00:00:00 2001 From: aricart Date: Thu, 1 Feb 2024 17:12:50 -0400 Subject: [PATCH] [CHANGE] import `share` was previously constrained to services. But with the new tracing functionality this is no longer true, as I understand it anything can be traced. --- v2/imports.go | 3 --- v2/imports_test.go | 24 ------------------------ 2 files changed, 27 deletions(-) diff --git a/v2/imports.go b/v2/imports.go index 4dc2f39..510430d 100644 --- a/v2/imports.go +++ b/v2/imports.go @@ -83,9 +83,6 @@ func (i *Import) Validate(actPubKey string, vr *ValidationResults) { } } - if i.Share && !i.IsService() { - vr.AddError("sharing information (for latency tracking) is only valid for services: %q", i.Subject) - } var act *ActivationClaims if i.Token != "" { diff --git a/v2/imports_test.go b/v2/imports_test.go index 7b08a68..d2faf41 100644 --- a/v2/imports_test.go +++ b/v2/imports_test.go @@ -291,30 +291,6 @@ func TestStreamImportWithWildcardPrefix(t *testing.T) { } } -func TestStreamImportInformationSharing(t *testing.T) { - ak := createAccountNKey(t) - akp := publicKey(ak, t) - // broken import share won't work with streams - i := &Import{Subject: "foo", Account: akp, Type: Stream, Share: true} - vr := CreateValidationResults() - i.Validate("", vr) - - if len(vr.Issues) != 1 { - t.Errorf("should have registered 1 issues with this import, got %d", len(vr.Issues)) - } - if !vr.IsBlocking(true) { - t.Fatalf("issue is expected to be blocking") - } - // import share will work with service - i.Type = Service - vr = CreateValidationResults() - i.Validate("", vr) - - if len(vr.Issues) != 0 { - t.Errorf("should have registered 0 issues with this import, got %d", len(vr.Issues)) - } -} - func TestImportsValidation(t *testing.T) { ak := createAccountNKey(t) akp := publicKey(ak, t)