Skip to content

Move Action may overwrite existing document path #516

Description

@reganwolfrom

While there are some safeguards to prevent duplicate filenames with the same folder, some actions can still result in duplicates. POST /search for meta of indexType 'folder' fails to return duplicates in its results.

To reproduce:

  1. Create a workflow with a MOVE action to a test folder, e.g., '/test'
  2. Create a test file, e.g., test.md
  3. Trigger the workflow; this will move the test file into the test folder
  4. Create another test file with the same path as the original file, e.g., test.md
  5. Trigger the workflow again to move the second test file into the test folder
  6. Verify if POST /search retrieves one document or two with the test file path, retrrieving from with the test folder

Current result: one file returned
Expected result: two files returned

NOTE: POST /fulltext on the test path, e.g., test.md, will show both files.

curl 'https://:host/search?siteId=MergersAcquisitions&limit=40' \
  -H 'accept: */*' \
  -H 'accept-language: en-CA,en-GB;q=0.9,en-US;q=0.8,en;q=0.7,fr;q=0.6' \
  -H 'authorization: ' \
  -H 'content-type: text/plain;charset=UTF-8' \
  -H 'origin: http://localhost:4200' \
  -H 'priority: u=1, i' \
  -H 'referer: http://localhost:4200/' \
  -H 'sec-ch-ua: "Chromium";v="148", "Google Chrome";v="148", "Not/A)Brand";v="99"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'sec-ch-ua-platform: "macOS"' \
  -H 'sec-fetch-dest: empty' \
  -H 'sec-fetch-mode: cors' \
  -H 'sec-fetch-site: cross-site' \
  -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/148.0.0.0 Safari/537.36' \
  --data-raw '{"query":{"meta":{"indexType":"folder","eq":"_quarantine/"}}'

Workflow example:

{
  "name": "Ingestion",
  "inUse": true,
  "description": "New Workflow Description",
  "steps": [
    {
      "stepId": "node_2cc39b5e-b355-46e6-942d-484ef830637b",
      "action": {
        "type": "LLMPROMPT",
        "parameters": {
          "llmPromptEntityId": "c292ee9b-11a0-4bee-b50a-3a1bceda63d3",
          "llmPromptEntityName": "{llmPromptEntityName}"
        }
      },
      "decision": {
        "defaultTransition": {
          "type": "COMPLETE"
        }
      },
      "decisions": [],
      "mappings": [
        {
          "mappingId": "36174c21-5d0d-453f-8db8-d61dbee97b3f"
        }
      ]
    },
    {
      "stepId": "node_b0ec7c5b-593b-4669-9295-82fa9499ea57",
      "action": {
        "type": "MALWARE_SCAN",
        "maxRetries": 1
      },
      "decision": {
        "conditions": [
          {
            "all": [
              {
                "source": {
                  "attributeKey": "malwareScanStatus"
                },
                "operator": "EQ",
                "stringValue": "CLEAN"
              }
            ],
            "transition": {
              "type": "STEP",
              "stepId": "node_077d8421-0f1f-40d5-85b5-bf64bd6a0fc1"
            }
          },
          {
            "all": [
              {
                "source": {
                  "attributeKey": "malwareScanStatus"
                },
                "operator": "EQ",
                "stringValue": "ERROR"
              }
            ],
            "transition": {
              "type": "RETRY"
            }
          },
          {
            "all": [
              {
                "source": {
                  "attributeKey": "malwareScanStatus"
                },
                "operator": "EQ",
                "stringValue": "MALICIOUS"
              }
            ],
            "transition": {
              "type": "STEP",
              "stepId": "node_b0ec7c5b-593b-4669-9295-82fa9499ea57_malware_smart_route_action"
            }
          }
        ],
        "defaultTransition": {
          "type": "COMPLETE"
        }
      },
      "decisions": [],
      "mappings": [
        {
          "mappingId": "7c889b36-6f3b-4e5d-b9f0-de5117842abe"
        }
      ]
    },
    {
      "stepId": "node_9138dcd7-c18f-4ca2-a084-88d0a81de57d",
      "action": {
        "type": "FULLTEXT"
      },
      "decision": {
        "defaultTransition": {
          "type": "STEP",
          "stepId": "node_2cc39b5e-b355-46e6-942d-484ef830637b"
        }
      },
      "decisions": []
    },
    {
      "stepId": "node_077d8421-0f1f-40d5-85b5-bf64bd6a0fc1",
      "action": {
        "type": "OCR",
        "parameters": {
          "ocrEngine": "TESSERACT",
          "ocrParseTypes": "TEXT"
        }
      },
      "decision": {
        "defaultTransition": {
          "type": "STEP",
          "stepId": "node_9138dcd7-c18f-4ca2-a084-88d0a81de57d"
        }
      },
      "decisions": []
    },
    {
      "stepId": "node_b0ec7c5b-593b-4669-9295-82fa9499ea57_malware_smart_route_action",
      "action": {
        "type": "MOVE",
        "parameters": {
          "path": "_quarantine/"
        }
      },
      "decision": {
        "defaultTransition": {
          "type": "COMPLETE"
        }
      },
      "decisions": []
    }
  ],
  "status": "ACTIVE"
}

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Fields

No fields configured for Bug.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions