-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Medium
-
Affects Version/s: None
-
None
-
STOP TB Sprint 9, STOP TB Sprint 10
Currently getAllForms() is called only once, at login. If the backend updates a form (for example, Contact Tracing) while the user is already logged in, the app keeps using the outdated schema. The app should check form versions through a new lightweight API and refetch the schemas only when a version mismatch is found.
Scope:
- Call the new Form Versions API at agreed trigger points, such as app launch, app resume from background, before opening a form, or after a sync. The exact points are to be finalized.
- Compare the returned versions with the locally stored form versions.
- If any version differs, call getAllForms() and store the updated schemas locally.
- If versions match, skip the full fetch.
- Handle offline cases and API failure gracefully by continuing with the locally stored forms.
Acceptance criteria:
- A logged-in user receives the updated form schema after the backend changes a form, without logging out and back in.
- getAllForms() is called only when a version mismatch exists.
- Local form versions are updated after a successful fetch.
- There are no crashes or blocked flows when offline or when the API fails.