Skip to content

Conflict in handling $unique between ActionFactory and DbStore #1284

Description

@davidarkemp

ActionFactory has a fallback for when the Store doesn't implement save_unique_action, which includes the 'args' in the uniqueness.

https://github.com/woocommerce/action-scheduler/blob/628fd3ccf87649ba470240afa9abc4adb8bce7e0/classes/ActionScheduler_ActionFactory.php#L354C2-L377C3

However, DBStore (eventually) only uses the hook and the group for uniqueness in build_where_for_insert_clause:

https://github.com/woocommerce/action-scheduler/blob/628fd3ccf87649ba470240afa9abc4adb8bce7e0/classes/data-stores/ActionScheduler_DBStore.php#L185C2-L217C3

  1. Is this conflict in behaviour intentional?
  2. If not, which is the intended behaviour?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions