Skip to content

FIX: Repeat the update request with the product, as the specification says - #270

Merged
jwrosewell merged 2 commits into
rcfrom
fix/data-update-product-spec
Nov 23, 2026
Merged

jwrosewell merged 2 commits into
rcfrom
fix/data-update-product-spec

Conversation

@jwrosewell

@jwrosewell jwrosewell commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Why

#268 handled the Distributor's 300 answer, sent when a license key holds several products, by following the URI the Distributor offers. The data updates specification (51Degrees/specifications#194) instead repeats the first request to the configured address with only the Product value added, and it adds a configured product. This brings python into line with it.

What changes

  1. On a 300 with a JSON AvailableUris list, the service repeats its first request with Product=<value> added, using the product of the loaded data file, with the same If-Modified-Since date.
  2. data_update_product_type is the configured product. When it is set, every request carries Product, including the first, and a 300 to such a request is not followed. With none set, no Product parameter is sent, and the formatter drops an empty one.
  3. Both update examples name a product only when given one, as their third argument, through data_update_product_type, which the published packages already have. The Device Detection example's keyed test still passes V4TAC.
  4. requests follows only 301, 302, 303, 307 and 308, so the Location header a 300 carries is not followed. Two new tests send a 300 whose Location points at another product and fail if it is followed.

Tests

SeveralProductsTests in pipeline/fiftyone_pipeline_engines/tests/test_datafile_update_http.py covers the second request, the configured product, the Location header, and a 300 whose list is empty or names no product, which is reported by its status. python -m pytest tests/test_datafile_update_http.py in pipeline/fiftyone_pipeline_engines on Python 3.12 gives 90 passed at this head.

… says

On a 300 that lists AvailableUris, the data file update service now repeats its
first request to the configured address with the Product value added, rather
than following the URI the Distributor offers. When data_update_product_type is
set, every request carries that product, including the first, and a 300 to it
is not followed. With none set, no Product parameter is sent. The update
examples name a product only when given one.
@jwrosewell jwrosewell mentioned this pull request Nov 23, 2026
A 300 answer whose AvailableUris list is empty or gives no Product value is
reported by its status, as any other response is and as the data updates
specification says, rather than as a product not offered. The test checks the
empty list and the list with no product.
@jwrosewell
jwrosewell marked this pull request as ready for review November 23, 2026 12:28
@jwrosewell
jwrosewell merged commit 435ae8c into rc Nov 23, 2026
7 checks passed
@jwrosewell
jwrosewell deleted the fix/data-update-product-spec branch November 23, 2026 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant