opensrp / fhircore

FHIR Core / OpenSRP 2 is a Kotlin application for delivering offline-capable, mobile-first healthcare project implementations from local community to national and international scale using FHIR and WHO Smart Guidelines on Android.
https://smartregister.org
Apache License 2.0
53 stars 41 forks source link

Add support for paginated List configurations endpoint during Config sync #3049

Closed ndegwamartin closed 4 months ago

ndegwamartin commented 7 months ago

Describe the feature request. Following the optimisation refactor to the plugin gateway here, we need to refactor the client to take advantage of the pagination.

Additional context Currently, when list entries are configure in the composition the whole list of references is fetched in one batch. This can lead to a high latency when processing the configs especially when we have a large number of entries. In some cases the connection will time out.

Acceptance criteria

Area path A list of ordered steps in the app on usage of the feature to support anyone testing it e.g. Code reviewer, QA e.g.

  1. Login to the app - e.g. SID app which uses the location hierarchy
  2. Perform sync to completion
  3. Go to Household and Add member. Use the location drop downs to assigning user location
  4. Save the record and confirm extraction was successful

Implementation plan (For Engineers) In the Config Registry class, add _page, _count and the List resource type in the function that fetches List Resources. Check the logs for the result of adding pagination. Refactor ConfigRegistry tests.