Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion dump.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func DumpForestToFile(m *InMemoryMatcher, filename string) error {
// Tenant header
graphLines = append(graphLines, fmt.Sprintf("# Tenant: %s", tenantKey))
mappingLines = append(mappingLines, fmt.Sprintf("# Tenant: %s", tenantKey))
graphs, relationship := make(map[string]bool), ""
graphs, relationship := make(map[string]any), ""

Copilot AI Sep 22, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change from map[string]bool to map[string]any with nil values is unnecessary and reduces type safety. The original boolean map approach was cleaner - the presence of a key in the map already indicates the relationship exists, making the value irrelevant.

Copilot uses AI. Check for mistakes.

// Snapshot NodeRelationships under forest lock
forest.mu.RLock()
Expand All @@ -145,6 +145,7 @@ func DumpForestToFile(m *InMemoryMatcher, filename string) error {
for rid, next := range trans {
relationship = fmt.Sprintf("%s %s", current, next)
if _, ok := graphs[relationship]; !ok {
graphs[relationship] = nil

Copilot AI Sep 22, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change from map[string]bool to map[string]any with nil values is unnecessary and reduces type safety. The original boolean map approach was cleaner - the presence of a key in the map already indicates the relationship exists, making the value irrelevant.

Copilot uses AI. Check for mistakes.
graphLines = append(graphLines, relationship)
}
b.WriteString(rid)
Expand Down
2 changes: 1 addition & 1 deletion matcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func newInMemoryMatcherWithContext(ctx context.Context, cancel context.CancelFun
eventsChan: make(chan *Event, 100),
nodeID: nodeID,
snapshotChanged: 0, // Initialize atomic flag to 1 (no changes)
ctx: ctx,
ctx: context.Background(),

Copilot AI Sep 22, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using context.Background() ignores the passed context parameter, which could break cancellation and timeout functionality. The original context should be used to maintain proper context propagation and cancellation behavior.

Suggested change
ctx: context.Background(),
ctx: ctx,

Copilot uses AI. Check for mistakes.
cancel: cancel,
}

Expand Down