Inconsistency of mapping rules in database

Description

Overview:

Each time POST /_/tenant called a new portion of default mapping rules is saved to the database. This may cause that not last updated rules will be used for records mapping.
Steps to Reproduce:

  1. Call POST /_/tenant on an empty database

  2. Call POST /_/tenant one more time

Expected Results: 1 rule per record type in the database
Actual Results: 2 rules per record type in the database.
Open questions:

  1. Should the module replace already existing mapping rules for default when the module is updating to a new version?

  2. We should clear the database from extra rules that have already been saved to the database. But due to database structure, we couldn't detect which rule is last updated. Will it be a big problem if we save default rules to the database instead of already existing?

Approach:

  1. Clear database from existed rules. (depends on the answer to the 2nd question)

  2. Modify database to have a unique constraint for `record_type` column.

  3. Modify logic of saving rules. Depends on the answer to the 1nd question:

    1. Replace existing rules with default ones.

    2. Don't save default rules if rule for recordType already exist in database

CSP Request Details

None

CSP Rejection Details

None

Potential Workaround

None

Attachments

1

Checklist

hide

TestRail: Results

Activity

Show:

Ann-Marie Breaux December 8, 2021 at 3:52 PM

That's really good to hear, . I'm glad the testing went well. Will leave this for or to review and close.

Charlotte Whitt December 8, 2021 at 10:44 AM
Edited

Oleksii Petrenko December 6, 2021 at 12:39 PM

Deployed to Kiwi bugfest. Please proceed with verification

Khalilah Gambrell December 3, 2021 at 12:46 PM
Edited

Hey all.

1. This issue prevents multiple mapping rules from being created.
2. Folijet will update Juniper and Kiwi Release Notes ask libraries to review custom mapping rules
3. Folijet will write a script () to be included in the Kiwi Release to remove any multiple mapping rules that were created in Juniper
4. Downgrading this issue from P1 to P2
cc:

Theodor Tolstoy (One-Group.se) December 2, 2021 at 5:45 PM

Thank you for pointing that out. I dived into this because I suspected it being related to https://folio-org.atlassian.net/browse/SUP-57 and I realize I am out on deep water...

Done

Details

Assignee

Reporter

Priority

Story Points

Sprint

Development Team

Spitfire

Fix versions

Release

R3 2021 Bug Fix

TestRail: Cases

Open TestRail: Cases

TestRail: Runs

Open TestRail: Runs

Created November 24, 2021 at 4:35 PM
Updated March 29, 2022 at 9:51 AM
Resolved December 3, 2021 at 11:48 AM
TestRail: Cases
TestRail: Runs