{"action":"created","issue":{"url":"https://api.github.com/repos/medic/medic-webapp/issues/2065","repository_url":"https://api.github.com/repos/medic/medic-webapp","labels_url":"https://api.github.com/repos/medic/medic-webapp/issues/2065/labels{/name}","comments_url":"https://api.github.com/repos/medic/medic-webapp/issues/2065/comments","events_url":"https://api.github.com/repos/medic/medic-webapp/issues/2065/events","html_url":"https://github.com/medic/medic-webapp/issues/2065","id":139909024,"number":2065,"title":"Targets are not always calculated correctly","user":{"login":"SCdF","id":583851,"avatar_url":"https://avatars.githubusercontent.com/u/583851?v=3","gravatar_id":"","url":"https://api.github.com/users/SCdF","html_url":"https://github.com/SCdF","followers_url":"https://api.github.com/users/SCdF/followers","following_url":"https://api.github.com/users/SCdF/following{/other_user}","gists_url":"https://api.github.com/users/SCdF/gists{/gist_id}","starred_url":"https://api.github.com/users/SCdF/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SCdF/subscriptions","organizations_url":"https://api.github.com/users/SCdF/orgs","repos_url":"https://api.github.com/users/SCdF/repos","events_url":"https://api.github.com/users/SCdF/events{/privacy}","received_events_url":"https://api.github.com/users/SCdF/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/medic/medic-webapp/labels/2%20-%20Active%20Work","name":"2 - Active Work","color":"bfd4f2"},{"url":"https://api.github.com/repos/medic/medic-webapp/labels/Bug","name":"Bug","color":"c10c02"},{"url":"https://api.github.com/repos/medic/medic-webapp/labels/Priority","name":"Priority","color":"ff0022"},{"url":"https://api.github.com/repos/medic/medic-webapp/labels/Returned","name":"Returned","color":"fbca04"}],"state":"open","locked":false,"assignee":{"login":"estellecomment","id":911434,"avatar_url":"https://avatars.githubusercontent.com/u/911434?v=3","gravatar_id":"","url":"https://api.github.com/users/estellecomment","html_url":"https://github.com/estellecomment","followers_url":"https://api.github.com/users/estellecomment/followers","following_url":"https://api.github.com/users/estellecomment/following{/other_user}","gists_url":"https://api.github.com/users/estellecomment/gists{/gist_id}","starred_url":"https://api.github.com/users/estellecomment/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/estellecomment/subscriptions","organizations_url":"https://api.github.com/users/estellecomment/orgs","repos_url":"https://api.github.com/users/estellecomment/repos","events_url":"https://api.github.com/users/estellecomment/events{/privacy}","received_events_url":"https://api.github.com/users/estellecomment/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/medic/medic-webapp/milestones/49","html_url":"https://github.com/medic/medic-webapp/milestones/April%204th%20-%20April%2018th:%20Frozen%20(Let%20It%20Go)","labels_url":"https://api.github.com/repos/medic/medic-webapp/milestones/49/labels","id":1682803,"number":49,"title":"April 4th - April 18th: Frozen (Let It Go)","description":"","creator":{"login":"browndav","id":763977,"avatar_url":"https://avatars.githubusercontent.com/u/763977?v=3","gravatar_id":"","url":"https://api.github.com/users/browndav","html_url":"https://github.com/browndav","followers_url":"https://api.github.com/users/browndav/followers","following_url":"https://api.github.com/users/browndav/following{/other_user}","gists_url":"https://api.github.com/users/browndav/gists{/gist_id}","starred_url":"https://api.github.com/users/browndav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/browndav/subscriptions","organizations_url":"https://api.github.com/users/browndav/orgs","repos_url":"https://api.github.com/users/browndav/repos","events_url":"https://api.github.com/users/browndav/events{/privacy}","received_events_url":"https://api.github.com/users/browndav/received_events","type":"User","site_admin":false},"open_issues":27,"closed_issues":4,"state":"open","created_at":"2016-04-04T19:01:00Z","updated_at":"2016-04-05T08:28:28Z","due_on":"2016-04-18T07:00:00Z","closed_at":null},"comments":26,"created_at":"2016-03-10T14:48:06Z","updated_at":"2016-04-05T10:15:33Z","closed_at":null,"body":"Initial discussion on #2064 .\r\n\r\nSome CHPs have shown us that every time they refresh they will get different target values for their targets. Another has shown us that a value is always 0, even though she has shown that she has filled out the requisite followup reports from the history page. \r\n\r\nSo there is clearly something funky going on with the rules."},"comment":{"url":"https://api.github.com/repos/medic/medic-webapp/issues/comments/205743450","html_url":"https://github.com/medic/medic-webapp/issues/2065#issuecomment-205743450","issue_url":"https://api.github.com/repos/medic/medic-webapp/issues/2065","id":205743450,"user":{"login":"estellecomment","id":911434,"avatar_url":"https://avatars.githubusercontent.com/u/911434?v=3","gravatar_id":"","url":"https://api.github.com/users/estellecomment","html_url":"https://github.com/estellecomment","followers_url":"https://api.github.com/users/estellecomment/followers","following_url":"https://api.github.com/users/estellecomment/following{/other_user}","gists_url":"https://api.github.com/users/estellecomment/gists{/gist_id}","starred_url":"https://api.github.com/users/estellecomment/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/estellecomment/subscriptions","organizations_url":"https://api.github.com/users/estellecomment/orgs","repos_url":"https://api.github.com/users/estellecomment/repos","events_url":"https://api.github.com/users/estellecomment/events{/privacy}","received_events_url":"https://api.github.com/users/estellecomment/received_events","type":"User","site_admin":false},"created_at":"2016-04-05T10:15:33Z","updated_at":"2016-04-05T10:15:33Z","body":"Maybe a callback registration problem. \r\n\r\nFirst emission from RulesEngine is [just after init](https://github.com/medic/medic-webapp/blob/develop/static/js/services/rules-engine.js#L307), nothing much happened yet. This always fires.\r\n\r\nSubsequent ones are emitted [from our custom events](https://github.com/medic/medic-webapp/blob/develop/static/js/services/rules-engine.js#L162), and these only fire if you reloaded the targets page. \r\n\r\nIf you just navigated to targets without reloading, you just get the first callback, so not much emissions in it yet, so your counts are too low."}}