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
Collaborator

Fixes https://roadmap.entgra.net/issues/12076

Simplified the if else block.
Removed duplicated line and introduced a method for them.

Fixes https://roadmap.entgra.net/issues/12076 Simplified the if else block. Removed duplicated line and introduced a method for them.
arshana790 added 1 commit 3 months ago
charithag reviewed 3 months ago
throws MetadataManagementException, DeviceManagementDAOException {
boolean isEnableDeviceStatusCheck = deviceStatusManagementService.getDeviceStatusCheck(tenantId);
boolean isValidState = deviceStatusManagementService.isDeviceStatusValid(type, enrolmentInfo.getStatus().name(), tenantId);
if (updatedRows == 1 && (!isEnableDeviceStatusCheck || (isEnableDeviceStatusCheck && isValidState))) {
Owner

this can be further simplified to

if (updatedRows == 1 && (!isEnableDeviceStatusCheck || isValidState))
this can be further simplified to ``` if (updatedRows == 1 && (!isEnableDeviceStatusCheck || isValidState)) ```
Poster
Collaborator

fixed the logic

fixed the logic
arshana790 marked this conversation as resolved
charithag requested changes 3 months ago
charithag left a comment
Owner

Check comments

Check comments
tcdlpds requested changes 3 months ago
}
/**
* Save the status according to status check(allowed device status)
Owner

Before invoking this method the calling function should have started a transaction, therefore please mention it in here.

Before invoking this method the calling function should have started a transaction, therefore please mention it in here.
arshana790 marked this conversation as resolved
arshana790 force-pushed status from 4dd1e1b17e to b2b4c5c676 3 months ago
tcdlpds merged commit 66c9c4f4e6 into master 3 months ago

Reviewers

charithag requested changes 3 months ago
tcdlpds requested changes 3 months ago
The pull request has been merged as 66c9c4f4e6.
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: community/device-mgt-core#530
Loading…
There is no content yet.