Backend: Form Version Check API and Backward Compatibility for Updated Form Versions

XMLWordPrintable

    • Type: Task
    • Resolution: Unresolved
    • Priority: High
    • 2.3
    • Affects Version/s: None
    • None
    • STOP TB Sprint 9, STOP TB Sprint 10

      This ticket covers the backend dependencies identified in the parent ticket [Parent Ticket ID]. Currently, the app calls the getAllForms API without checking whether the forms on the device are already up to date. This causes unnecessary data transfer and can lead to issues when form definitions change. The proposed flow and details of the issue are explained in the comments of the parent ticket.

      Requirements:

      1. Form Version Check API
        • Create a new API that returns the current version of each form available on the server.
        • The client will compare these versions with the locally stored versions.
        • If a version mismatch is found, the client will trigger the getAllForms API to fetch the updated forms. If all versions match, getAllForms will not be called.
        • The response should be lightweight (e.g., form ID, form name, and current version) so it can be called frequently without performance impact.
      2. Backward Compatibility of Existing Form Data
        • Discuss and verify how existing form data (already submitted or saved offline under older form versions) will behave with the updated form versions.
        • Identify cases such as added, removed, renamed, or modified fields and define how each will be handled.
        • Confirm that data submitted with an older form version is still accepted, stored correctly, and displayed without errors.

      Acceptance Criteria:

      • A new API is available that returns the current version for all forms.
      • getAllForms is triggered only when a version mismatch is detected.
      • Backward compatibility approach is discussed, documented, and verified with the team.
      • Existing form data continues to work correctly after form versions are updated.
      • API contract (request/response format) is shared with the frontend/app team.

      Reference: Please refer to the comments in [Parent Ticket ID] for the detailed issue explanation and proposed flow.

              Assignee:
              Brijesh Singh
              Reporter:
              Shivani Garg
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: