Soft-deleted record was skipped when re-ingested with same data
Steps to reproduce the current behavior:
- Ingest a record
- Soft-delete the record
- Fetch the record to confirm it is now "inactive", "not found"
Case 1: Works as expected
- Ingest the same record using the same id and DIFFERENT data, skipdupes=true
Record was NOT skipped. Deleted record became active again. A new version of the record is created. Example response:
{
"recordCount": 1,
"recordIds": [
"osdu:document:ee7e8869217541a8b31f4e2ea18f7e3a"
],
"skippedRecordIds": [],
"recordIdVersions": [
"osdu:document:ee7e8869217541a8b31f4e2ea18f7e3a:1654731042152281"
]
}
- Soft-delete the record
- Fetch the record to confirm it is now "inactive", "not found"
Case 2: Skips the record even though it was already deleted
- Ingest the same record using the same id, SAME data, skipdupes=true
Record was skipped. So the record remains "inactive", "not found". The PUT call did nothing to the record. Example response:
{
"recordCount": 1,
"skippedRecordIds": [
"slb-osdu-dev-sis-internal-hq:document:ee7e8869217541a8b31f4e2ea18f7e3a"
]
}
Expected behavior:
If skipdupes is true
- if the record doesn't exist at all, then create a new record.
- if the record was soft-deleted, then make the record active again if the data is the same (last deleted version becomes the latest version), or create a new version if data is different.
- if the record exists,
- if the data is the same, then skip it.
- if data is different, then create a new version
If skipdupes is false:
- if the record doesn't exist at all, then create a new record.
- if the record was soft-deleted, then create a new version of the record
- if the record exists, then a new version of the record will be created, regardless whether the data is the same or different.