Refresh form schemas when backend form versions change

XMLWordPrintable

    • Type: Task
    • Resolution: Unresolved
    • Priority: Medium
    • 2.3
    • 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:

      1. A logged-in user receives the updated form schema after the backend changes a form, without logging out and back in.
      2. getAllForms() is called only when a version mismatch exists.
      3. Local form versions are updated after a successful fetch.
      4. There are no crashes or blocked flows when offline or when the API fails.

              Assignee:
              Deep Shikha
              Reporter:
              Shivani Garg
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: