From fdd5e83d24761fe3ef2e0a1ec2f13e3becf93fad Mon Sep 17 00:00:00 2001 From: Alex Cottner Date: Wed, 17 Jun 2026 04:24:40 -1000 Subject: [PATCH 1/2] Making git-reader return 206 for older expected than since values --- git-reader/app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/git-reader/app.py b/git-reader/app.py index 9a0fa061..e812c701 100644 --- a/git-reader/app.py +++ b/git-reader/app.py @@ -678,7 +678,7 @@ def monitor_changes( ): if _since and _expected > 0 and _expected < _since: raise HTTPException( - status_code=400, + status_code=206, detail="_expected must be superior to _since if both are provided", ) @@ -713,7 +713,7 @@ def collection_changeset( ): if _since and _expected > 0 and _expected < _since: raise HTTPException( - status_code=400, + status_code=206, detail="_expected must be superior to _since if both are provided", ) From 108a7b7a9ce06f5adf020c469246fbbc7fae577d Mon Sep 17 00:00:00 2001 From: Alex Cottner Date: Wed, 17 Jun 2026 04:56:26 -1000 Subject: [PATCH 2/2] Adjusting unit tests --- git-reader/tests/test_api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/git-reader/tests/test_api.py b/git-reader/tests/test_api.py index 60d8037d..3ca4bc49 100644 --- a/git-reader/tests/test_api.py +++ b/git-reader/tests/test_api.py @@ -417,7 +417,7 @@ def test_monitor_changes_view_filtered_bad_since(api_client): resp = api_client.get( "/v2/buckets/monitor/collections/changes/changeset?_since=223456789&_expected=123456789" ) - assert resp.status_code == 400 + assert resp.status_code == 206 def test_monitor_changes_negative_values(api_client): @@ -491,7 +491,7 @@ def test_changeset_bad_since(api_client, since): resp = api_client.get( f"/v2/buckets/main/collections/password-rules/changeset?_since={since}&_expected=123456789" ) - assert resp.status_code in (400, 422) + assert resp.status_code in (206, 422) @pytest.mark.parametrize("_expected", ["", "-1", "abc", '"42"'])