Please specify exactly which cases will sync down to a mobile device when using CommCare

commcare

I have a user whose Case List Report of all open cases on CommCareHQ is reporting fewer cases than that user is seeing synced down- by a significant amount.

That user is in a few case sharing groups, can that account for the discrepancy?

The user also appears to be syncing down cases that it owns through the case sharing configuration, but that it never opens (lacking a module for those cases in its app). Are there any situations where CommCare doesn't sync down all the open cases to the mobile device?

Best Answer

It's pretty complex to identify what cases are synced down to a device, but it's roughly something like

  • Open Cases owned by the user
  • Open Cases owned by any group (or location which owns cases) the user is a member of
  • Cases which are extension cases of an Open Case owned for any other reason
    • [Owned Case <-(extension)-- Extension Case]
  • Cases which are parent cases of an open case owned for any other reason
    • [Owned Child Case --(parent)-> Parent Case]

These cases are always sent to the device for an app, regardless of whether the app uses them. CommCare HQ can't easily detect what case types are / aren't relevant to an application due to some complex things you can do, so it doesn't attempt to filter the cases.