Skip to content
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

Fix invocations to RuleEvaluationService.validateSummaries() to pass valid individualUUID #1159

Closed
1 task done
himeshr opened this issue Oct 27, 2023 · 3 comments
Closed
1 task done
Assignees

Comments

@himeshr
Copy link
Contributor

himeshr commented Oct 27, 2023

Describe the bug

Created for issue reported in ticket 3179
On any SubjectType's Summary rule failure, currently we fail to capture the actual Summary rule failure, due to missing individualUUID value in invocations to RuleEvaluationService.validateSummaries().

To Reproduce
Steps to reproduce the behavior:

  1. Go to any SubjectType SummaryRule and add a errorneous logic, storing a value for invalid concept name
  2. Sync to client
  3. Create an Individual of that subjectType and open the individual
  4. The error recorded in RuleFailureTelemetry would be about "Exception in HostFunction: Missing value for property 'RuleFailureTelemetry.individualUuid'", rather than the Summary Rule exception

Expected behavior
A ruleFailureTelemetry for SubjectType SummaryRule exception should be created instead

Smartphone (please complete the following information):

  • Version 5.0.3 (Playstore version)

Additional context
Issue occurs for Goonj "Dispatch" SubjectType Summary Rule.

Developer Checklist
Developer fixing the bug should fill this checklist.

  • [x ] Does the fix require extensive regression testing? No
  • Are you mentioning the required scenarios that could be affected?

Test Scenarios

  • Go to any SubjectType's SummaryRule and add the following :
"'use strict';
({params, imports}) =>  {
  const {summaries, individual} = params;

     summaries.push({
       name: ""Invalid Concept name"",
       value: individual.that.lowestAddressLevel.locationMappings[0].parent.name
     });
    
    console.log(summaries);
    return summaries;
};"

This should result in a RuleFailureTelemetry to be created about SubjectType SummaryRule exception, rather than creating RuleFailureTelemetry about "Exception in HostFunction: Missing value for property 'RuleFailureTelemetry.individualUuid'",

Reference SQL commands

set role goonj;

select id, uuid, name, subject_summary_rule  from subject_type; /* where uuid = 'bc0a4ae3-77b3-4620-81c4-2d02d1c62280';*/

select error_message, count(*) from rule_failure_telemetry
-- where id > 54640
group by error_message
-- order by error_date_time desc;

select error_date_time from rule_failure_telemetry
where error_message = 'Cannot read property ''name'' of null'
-- group by error_message;
@himeshr himeshr moved this to Ready in Avni Product Oct 27, 2023
@himeshr himeshr self-assigned this Oct 27, 2023
@himeshr himeshr moved this from Ready to In Progress in Avni Product Oct 27, 2023
himeshr added a commit that referenced this issue Oct 27, 2023
@himeshr himeshr moved this from In Progress to Code Review Ready in Avni Product Oct 27, 2023
@ashusvnath ashusvnath moved this from Code Review Ready to In Code Review in Avni Product Oct 30, 2023
@ashusvnath ashusvnath moved this from In Code Review to QA Ready in Avni Product Oct 30, 2023
@mahalakshme
Copy link
Contributor

mahalakshme commented Oct 31, 2023

@himeshr the implementation rule is fixed right? @cc: @nupoorkhandelwal

@himeshr
Copy link
Contributor Author

himeshr commented Oct 31, 2023

@himeshr the implementation rule is fixed right? @cc: @nupoorkhandelwal

Yes, rule has been fixed in goonj and goonjUat orgs

@AchalaBelokar AchalaBelokar moved this from QA Ready to In QA in Avni Product Nov 1, 2023
@AchalaBelokar
Copy link

I tried with apfodishauat but summery rule is showing there.

@AchalaBelokar AchalaBelokar moved this from In QA to Done in Avni Product Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

4 participants