Skip to content

Logic error in IdentifyMissingComments #4814

@e-gineer

Description

@e-gineer

Description

The IdentifyMissingComments() function has a logic error on line 426. Uses OR (||) when it should use AND (&&). Current logic: "if NOT updating OR deleting" means connections being deleted are still added to MissingComments, contradicting intended behavior.

Severity

LOW - Wasted work but doesn't cause incorrect behavior

Reproduction

  1. Create ConnectionUpdates with a connection marked for deletion
  2. Set CommentsSet to false for that connection
  3. Call IdentifyMissingComments()
  4. Observe that the deleted connection is added to MissingComments

Expected Behavior

if \!updating && \!deleting {
    log.Printf("[TRACE] connection %s comments not set, marking as missing", name)
    u.MissingComments[name] = state
}

Test Reference

Test: TestConnectionUpdates_IdentifyMissingComments in pkg/steampipeconfig/connection_updates_test.go:125

Related Code

  • pkg/steampipeconfig/connection_updates.go:426

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions