dimagi / commcare-android

Offline First Android software client for CommCare, the world's largest platform for designing, managing, and deploying robust mobile applications to frontline workers worldwide
https://www.dimagi.com/open-source/
Apache License 2.0
38 stars 27 forks source link

Pass query params to HTTP requests that don't require authentication #2793

Closed avazirna closed 3 months ago

avazirna commented 3 months ago

Summary

This PR fixes an issue that is causing the app_id in the response body of the Recovery Measures GET request to be null.

{
    "latest_apk_version": "2.53.1",
    "latest_ccz_version": 127,
    "app_id": null,
    "recovery_measures": [
        {
            "sequence_number": 9,
            "type": "app_reinstall_and_update",
            "app_version_min": 128,
            "app_version_max": 131
        }
    ]
}

In CommCareHQ, the app_id is added to the response body from the GET request itself, from a query param, and because the existing logic that builds HTTP requests for requests that don't need authentication is ignoring any params that have been passed, the app_id is not part of the request, causing it to be null in the response body. With the app_id logic not present the Recovery Measures are not being triggered when they should.

cross-request: https://github.com/dimagi/commcare-core/pull/1422 Ticket: https://dimagi.atlassian.net/browse/QA-6606

Safety Assurance

Safety story

This only passes query params for HTTP requests without auth

avazirna commented 3 months ago

@damagatchi retest this please

avazirna commented 3 months ago

@damagatchi retest this please