From 1b105f324321d8313d085b8ee771b6c6baebf048 Mon Sep 17 00:00:00 2001 From: James Rosewell Date: Sun, 6 Dec 2026 09:04:55 +0000 Subject: [PATCH] FIX: Leave the browserderived engine out of the cloud web example The cloud pipeline builder now adds the browserderived engine, so the browser tests reached the cloud web example's page. A test counts as done only once the page holds a sealed HumanConfidence, and the package never sends that to the page. The client script ran the tests again on the next page and called the JSON endpoint, which failed the four SessionStorageCache cases of the browser contract. The example now takes the builder's elements without that engine. The .NET and Java web examples build from a configuration file that has no browserderived engine, and the Rust example leaves it out the same way. The builder and the packages are unchanged. --- .../cloud/gettingstarted_web/app.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/device-detection/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/cloud/gettingstarted_web/app.py b/device-detection/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/cloud/gettingstarted_web/app.py index 69261224..0e59af82 100644 --- a/device-detection/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/cloud/gettingstarted_web/app.py +++ b/device-detection/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/cloud/gettingstarted_web/app.py @@ -157,9 +157,19 @@ def build(self, resource_key, logger): if cloud_endpoint: pipeline_settings["cloud_endpoint"] = cloud_endpoint - GettingStartedWeb.pipeline = DeviceDetectionCloudPipelineBuilder( - **pipeline_settings).add_logger(logger).build() - + builder = DeviceDetectionCloudPipelineBuilder(**pipeline_settings) + + # The builder adds the browserderived engine, which this page leaves + # out. The browser tests count as done only once the page holds a + # sealed HumanConfidence, and the package never sends that to the + # page. With the browserderived engine, the client script would run + # them again and call the JSON endpoint on every page view. + builder.flow_elements = [ + element for element in builder.flow_elements + if element.datakey != "browserderived"] + + GettingStartedWeb.pipeline = builder.add_logger(logger).build() + return self def run(self):