Skip to content

: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.

fix(warehouse-sources): classify appfigures retryable error as transient (#118538)

posthog[bot]0e4db11c16e0
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/appfigures/source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/appfigures/source.py
index c8c82ff49fe4..359d67912348 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/appfigures/source.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/appfigures/source.py
@@ -107,6 +107,11 @@ Stores, Categories, and Countries are reference tables that need no data set gra
"Some given products are not owned by your account": "Your Appfigures account doesn't own one or more products this sync needs credits for. Check product ownership and available credits in Appfigures, then reconnect.",
}
+ def get_retryable_errors(self) -> set[str]:
+ # _fetch raises this only after its own backoff runs out on a 429 or 5xx. Temporal then
+ # retries the activity, so log it at warning instead of raising an error tracking issue.
+ return {"Appfigures API error (retryable)"}
+
def get_schemas(
self,
config: AppfiguresSourceConfig,
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/appfigures/tests/test_appfigures_source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/appfigures/tests/test_appfigures_source.py
index fbda47e5bae0..b4497a4f4deb 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/appfigures/tests/test_appfigures_source.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/appfigures/tests/test_appfigures_source.py
@@ -21,6 +21,11 @@ class TestAppfiguresSource:
# get_schemas is a static catalog with no I/O, so the public docs can render the table list.
assert self.source.lists_tables_without_credentials is True
+ def test_retryable_errors_match_transient_status_raise(self):
+ observed_error = "Appfigures API error (retryable): status=503, url=https://api.appfigures.com/v2/products/mine"
+ retryable_errors = self.source.get_retryable_errors()
+ assert any(key in observed_error for key in retryable_errors)
+
@pytest.mark.parametrize(
"status,schema_name,expected_ok",
[