Skip to content

ContextMod not properly parsing Report Reasons #131

@quentinwolf

Description

@quentinwolf

ContextMod is not correctly parsing User Report Reasons on comments/submissions

To recreate the issue,

Create a couple basic rule in ContextModerator to leave a Comment based upon a specified report reason that begins with a specific but unique term:


    # Contact Info Strike
      - name: contactinfo strike
        kind: comment
        itemIs:
          - criteria:
            - source:
                - 'poll:modqueue'
                - 'user'
              reports: '>= 1 \Contact Info Strike.*\'
        actions:
            - kind: comment
              enable: true
              content: 'Comment removed for Contact Info Violation.'
            - kind: remove
              enable: true
        postTrigger: stop



    # Paysite Strike
      - name: paysite strike
        kind: comment
        itemIs:
          - criteria:
            - source:
                - 'poll:modqueue'
                - 'user'
              reports: '>= 1 \Paysite Strike.*\'
        actions:
            - kind: comment
              enable: true
              content: 'Comment removed for Paysite Violation.'
            - kind: remove
              enable: true
        postTrigger: stop

And then report a comment as either "Contact Info Strike ..." or "Paysite Strike ...", regardless of what you choose, ContextMod will only match the first rule in sequence for detecting any report, without actually matching the report reason.

With the above rules, anything coming in that's reported will always match the "Contact Info Strike" rule. Even if the report reason is "Paysite Strike ...". If you re-arrange the above rules so Paysite Strike is on top, then all reports will always match the "Paysite Strike" rule and never trigger the "Contact Info Strike" rule.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions