:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
fix(webflow): stop retrying syncs for deleted CMS collections (#75773)
Tom Owers2254d230ec62
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/webflow/source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/webflow/source.pyindex b721470dedb2..1a09fde744ca 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/webflow/source.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/webflow/source.py@@ -67,6 +67,11 @@ class WebflowSource(ResumableSource[WebflowSourceConfig, WebflowResumeConfig]):# the site has unpublished changes. Both are deterministic state/config issues# that retrying can't resolve, so stop retrying and tell the user how to fix it."409 Client Error: Conflict": "Webflow returned a 409 Conflict. For the Products and Orders tables this means the connected site does not have ecommerce enabled — enable ecommerce in Webflow or remove those tables from the sync. For other resources it can mean the site has unpublished changes; publish your Webflow site, then try again.",+ # A CMS collection discovered when the table was set up can later be deleted or have its+ # slug renamed in Webflow, so at sync time the slug no longer resolves to a collection.+ # That's a deterministic upstream state change retrying can't fix. Match the stable+ # prefix, not the schema name and site id that follow it.+ "Webflow collection for schema": "A Webflow CMS collection PostHog was syncing no longer exists on your site. It was deleted or renamed in Webflow. Refresh this source's schemas to pick up your current collections, then remove the table for the collection that's gone.",}def get_schemas(diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/webflow/tests/test_webflow_source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/webflow/tests/test_webflow_source.pyindex a5f4935e4e3a..049e51ac1ba7 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/webflow/tests/test_webflow_source.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/webflow/tests/test_webflow_source.py@@ -59,6 +59,7 @@ class TestWebflowSource:assert "401 Client Error" in errorsassert "403 Client Error" in errorsassert "409 Client Error: Conflict" in errors+ assert "Webflow collection for schema" in errorsdef test_409_conflict_message_is_recognised_as_non_retryable(self) -> None:# Webflow returns 409 on /products when the site has no ecommerce; the raised@@ -72,6 +73,15 @@ class TestWebflowSource:matches = [pattern for pattern in errors if pattern in raised_message]assert matches == ["409 Client Error: Conflict"]+ def test_deleted_collection_message_is_recognised_as_non_retryable(self) -> None:+ # _resolve_collection_id raises this when a collection's slug no longer resolves at sync+ # time; the message embeds a volatile schema name and site id, so we must match on a stable+ # substring that excludes them.+ errors = WebflowSource().get_non_retryable_errors()+ raised_message = "Webflow collection for schema 'collection_blog' was not found on site 'abc123'"+ matches = [pattern for pattern in errors if pattern in raised_message]+ assert matches == ["Webflow collection for schema"]+def test_get_schemas_includes_static_and_dynamic_collections(self) -> None:with patch(f"{SOURCE_MODULE}.list_collections",