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(appfigures): stop retrying reviews sync when the account lacks product credits (#79375)

Tom Owers68fed3d25786
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 a04ed87c7774..b483266d6350 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
@@ -89,6 +89,9 @@ Create an API client and Personal Access Token at [appfigures.com/developers/key
return {
"401 Client Error: Unauthorized for url: https://api.appfigures.com": "Your Appfigures personal access token is invalid or expired. Create a new token in your Appfigures developer settings, then reconnect.",
"403 Client Error: Forbidden for url: https://api.appfigures.com": "Your Appfigures personal access token is missing the scope needed to sync this data. Grant the required data sets to your API client, then reconnect.",
+ # Appfigures returns this 403 (with a custom reason phrase, not "Forbidden") when the
+ # account no longer owns one or more products the request covers — no retry fixes that.
+ "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_schemas(
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 e88cd7053807..485a1c711b7b 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
@@ -115,6 +115,7 @@ class TestAppfiguresSource:
[
"401 Client Error: Unauthorized for url: https://api.appfigures.com/v2/reviews?count=1",
"403 Client Error: Forbidden for url: https://api.appfigures.com/v2/reports/sales",
+ "403 Client Error: This request requires 3 credit(s). Reason: Some given products are not owned by your account. (the first one is: 338244644767 for url: https://api.appfigures.com/v2/reviews?count=500&page=1&sort=date&start=2026-08-05",
],
)
def test_non_retryable_errors_match_auth_failures(self, observed_error):