From a9ca8394c4094f25c2320a03fc3b1f49b5ce1143 Mon Sep 17 00:00:00 2001 From: Jay Date: Fri, 22 May 2026 17:05:31 -0400 Subject: [PATCH] minor fixes --- subgraph.go | 4 ---- write.go | 8 ++++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/subgraph.go b/subgraph.go index ec00019..57dfa17 100644 --- a/subgraph.go +++ b/subgraph.go @@ -56,10 +56,6 @@ func (s *EventSubgraph) FirstNodeByLabel(label string) *Node { // Helpers func IsValidTag(t roots.Tag) bool { - if len(t) < 2 { - // Skip tags that do not have name and value fields - return false - } if len(t[0])+len(t[1]) > 8192 { // Skip tags that are too large for the neo4j indexer return false diff --git a/write.go b/write.go index be18d3e..f57576c 100644 --- a/write.go +++ b/write.go @@ -21,7 +21,7 @@ type preparedWrite struct { Subgraph *EventSubgraph } -type excludedEvent struct { +type ExcludedEvent struct { Event roots.ValidatedEvent Reason error } @@ -32,7 +32,7 @@ type WriteResult struct { } type WriteReport struct { - ExcludedEvents []excludedEvent + ExcludedEvents []ExcludedEvent CreatedEventCount int Neo4jResultSummaries []neo4j.ResultSummary Duration time.Duration @@ -81,7 +81,7 @@ func setDefaultWriteOptions(opts *WriteOptions) { } } -func enforcePolicyRules(in []roots.ValidatedEvent, boltdb *bolt.DB, batchSize int) (queued []roots.ValidatedEvent, excluded []excludedEvent) { +func enforcePolicyRules(in []roots.ValidatedEvent, boltdb *bolt.DB, batchSize int) (queued []roots.ValidatedEvent, excluded []ExcludedEvent) { for i := 0; i < len(in); i += batchSize { end := i + batchSize if end > len(in) { @@ -98,7 +98,7 @@ func enforcePolicyRules(in []roots.ValidatedEvent, boltdb *bolt.DB, batchSize in for _, e := range batch { if existsMap[e.ID()] { - excluded = append(excluded, excludedEvent{ + excluded = append(excluded, ExcludedEvent{ Event: e, Reason: fmt.Errorf("skipped: %w", ErrDuplicate), })