Fix Device statuses intermitantly not saving issue #530
Merged
tcdlpds
merged 1 commits from arshana790/device-mgt-core-fork:status
into master
3 months ago
Loading…
Reference in new issue
There is no content yet.
Delete Branch 'arshana790/device-mgt-core-fork:status'
Deleting a branch is permanent. It CANNOT be undone. Continue?
Fixes https://roadmap.entgra.net/issues/12076
Simplified the if else block.
Removed duplicated line and introduced a method for them.
throws MetadataManagementException, DeviceManagementDAOException {
boolean isEnableDeviceStatusCheck = deviceStatusManagementService.getDeviceStatusCheck(tenantId);
boolean isValidState = deviceStatusManagementService.isDeviceStatusValid(type, enrolmentInfo.getStatus().name(), tenantId);
if (updatedRows == 1 && (!isEnableDeviceStatusCheck || (isEnableDeviceStatusCheck && isValidState))) {
this can be further simplified to
fixed the logic
Check comments
}
/**
* Save the status according to status check(allowed device status)
Before invoking this method the calling function should have started a transaction, therefore please mention it in here.
4dd1e1b17e
tob2b4c5c676
3 months ago66c9c4f4e6
into master 3 months agoReviewers
66c9c4f4e6
.