-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
App crash when due date not saved for encounter #1430
Comments
…sitDateTime Return empty array instead of pre-existing visits if error occurs during visit schedule rule execution Check for null before converting toISTDate
AC updated in issue description after discussion of how this should be handled. |
@1t5j0y so you mean app will also not get crashed like now (say for the above case when saving electricity encounter) right? asking since app is not getting crashed currently when scheduling visits. Its happening when comparing datesAreSame with already scheduled visits which doesn't have datetime. |
correct. Visit schedule rules returning visits without earliestVisitDateTime will fail and be reported to rule failure telemetry and not be scheduled so will not crash since they will not be checked via |
@1t5j0y okay got it. the null checks will help for the existing encounters already scheduled wrongly and the rule failure will help for the future ones. so have appended the previous AC to the newly added ones. |
…since the pre-existing visits are returned by default
for QA
|
Extract note : The issue is encounter not scheduled in the latest version 9.0 env : pre-release My.Movie.mp4Note : this is not happening in 8.1 env : pre-release My.Movie.mp4 |
Scenario 1 : Unplanned visit if the visit is done as unplanned visit they the visit getting scheduled with earliest visit as null and it is not creating any rule failure Screenshot of the db: screenshot of cilent app : Scenario 2 : scheduled the encounter with earliestvisit date as Null if complete the registration and the general encounter needs to scheduled but if the earliest visit date is null it is not scheduling the visit. And rule failure is capture as expected screenshot of webapp : screenshot of cilent app : |
@Dinesh2019 @AchalaBelokar scenario 1 is working as expected since we performed an unscheduled visit in that case and did not schedule a visit. For an unscheduled visit, |
https://avni.freshdesk.com/a/tickets/4174
Analysis:
Currently for scheduled encounters(general or program) earliest_visit_date_time and max_visit_date_time can be null. There are no db constraints and this can happen when visit schedule rule is incorrectly(shelter - prerelease - visit schedule rule of
KAP-Survey Enrolment
form) written. This was not an issue until 7.3 but with adding of checks for encounters(to see if on edit visits scheduled is same as existing one) leads to app crash because of not sufficient checks added to handle when dates don't exist.Steps to reproduce:
prod, shelter
assign yourself the "KMC_Kalamba Filter House" catchment, turn off the internet and search for '0082' household subject_type, and try to complete 'Electricity' general encounter.
AC:
datesAreSame
function to handle for the existing encounters saved without datetime fields.Long term fix: (not part of AC)
Such saving needs to be probably blocked from CSV, visit schedule rule and by adding deferred constraint in db (can be dealt in later releases)
The text was updated successfully, but these errors were encountered: