Defect #3009
closed
Contract slice synchronization doesn't fill validTill inside slice
Added by Ondřej Kopr about 3 years ago.
Updated about 3 years ago.
Description
Contract slice synchronization and inner slice behavior must process new slices and old one with process that fill valid till for contract slice:
One of our project has contract slice synchronization that execute all crud operation (important is delete).
When inside one sznchronization is processed create and delete for one exactly same contract slice tha valid till isn't filled and SelectCurrentContractSliceTaskExecutor every day process same two slices for one user.
Result of these operation is that one day is user valid and second one will be blocked including role remove.
This behavior was explored by transaction log and audit analyzing. We have more cases and more data for debug the process.
Simulation on clear product version is also very easy.
- create user contract-slice-test without contract,
- create contract slice synchronization from CSV is enough,
- set up reconciliation including HR process and all another,
- set up source data:
id;identity;contract;valid-from-slice;valid-from;valid-till
100;contract-slice-test;contract-one;2018-09-01;2018-09-01;2019-03-31
200;contract-slice-test;contract-one;2019-04-01;2019-04-01;9999-12-31
- run synchronzation, after this run is everything OK,
- update source data
id;identity;contract;valid-from-slice;valid-from;valid-till
100;contract-slice-test;contract-one;2018-09-01;2018-09-01;2019-03-31
300;contract-slice-test;contract-one;2019-04-01;2019-04-01;2022-01-31
- run synchronization.
After this run missing valid till appears :( like upper image.
Files
Now doesn't exists simple workarround. Fix already existing issue is only about move date valid from on one of wrong created slices. Thats all.
Existing issues can be founded by sql (tested on local environment):
select * from idm_contract_slice s where s.valid_till is null and (select count(*) from idm_contract_slice s2 where s2.parent_contract_id = s.parent_contract_id and s2.valid_till is null) >= 2;
- Priority changed from High to Urgent
This issue probably appears after any reconciliation that execute contract slice delete.
It can't be solved by split reconciliation into two different transaction :(
- Assignee changed from Franta Vomáčka to Roman Kučera
- Status changed from New to In Progress
- % Done changed from 0 to 10
After consultation with Ondra. I replicate this issue on my local env.
Tried simple fix in DefaultContractSliceManager and this specific use case seems OK now.
I need to rerun tests and do more tests to be sure.
- % Done changed from 10 to 40
I run all test in core-impl and it seems OK.
(Thera are 17 failed test but as it looks it has nothing to do with contract slice and the same test failed even before the fix on my local env)
- Affected versions 11.0.0, 11.1.0, 11.1.2, 11.1.1, 11.2.0, 11.2.1, 11.2.2, 11.2.3, 12.0.0 added
- % Done changed from 40 to 70
I'll test following cases (I'll update this note with additional one and with results):
- new slice with different ID and same valid from, remove previous (this tiket) - OK
- new slice with same ID and same valid from - OK
- new slice from yesterday to different end date - OK
- new slice in future - OK
- change validity of current slice to past and add new slice for current date - OK
- new slice in past - OK
- deleting all slices except for one in past, add new current - OK
- Status changed from In Progress to Needs feedback
- Assignee changed from Roman Kučera to Peter Štrunc
- Target version set to 12.0.1
- % Done changed from 70 to 90
I added test for this new use case.
Before fix -> fail
After fix -> success
Build on CI where successful and sonar is OK to.
- Status changed from Needs feedback to Resolved
- % Done changed from 90 to 100
LGTM. thanks for the fix. Please just mention the fact, that we do not support having two concurrent contract slices starting at the same time, in the documentation.
- Status changed from Resolved to Closed
- Assignee changed from Peter Štrunc to Roman Kučera
Also available in: Atom
PDF