Skip to content

Add ability to ignore list order when comparing objects #32

@bettyand

Description

@bettyand

Description

Currently, Lists with the same elements in a different order are considered changed and therefore audited. For my team's use case, this change is not meaningful and adds clutter to our audits. We would like to be able to ignore order when comparing lists.

Proposed solution

add an ignoreListOrder boolean to AuditorEventConfig. add a method to ObjectDiffCheckerService to use instead of the simple previousValue != updatedValue check, something like this:

image

using hashCodes to sort and compare means it doesn't matter what type of element is in the list

Alternatives considered

this could be the default, but some users might care about list order so i think it's better to have it be configurable. i also thought about trying to let users pass in a comparison method through the configuration, but that would leave more room for error and may not be needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions