: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(gladly): widen the events retention safety margin (#127456)
Tom Owers72647cd47769
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/gladly/gladly.py b/products/warehouse_sources/backend/temporal/data_imports/sources/gladly/gladly.pyindex aeff6288a346..0574844833a1 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/gladly/gladly.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/gladly/gladly.py@@ -41,8 +41,10 @@ REPORT_ROW_WARNING_THRESHOLD = 90_000# windows are paced instead of riding the 429 backoff.REPORT_REQUEST_INTERVAL_SECONDS = 6.0# Gladly rejects an events startAt older than 24 hours. The margin keeps the-# first window inside that limit by the time its request arrives.-EVENTS_RETENTION = timedelta(hours=24) - timedelta(minutes=5)+# first window inside that limit by the time its request arrives; a 5-minute+# margin was observed too tight against clock skew and latency between here+# and Gladly's own check, so it 400'd on a first sync.+EVENTS_RETENTION = timedelta(hours=24) - timedelta(minutes=30)EVENTS_WINDOW = timedelta(hours=1)VOICE_ITEM_TYPES = ("PHONE_CALL", "VOICEMAIL")diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/gladly/tests/test_gladly.py b/products/warehouse_sources/backend/temporal/data_imports/sources/gladly/tests/test_gladly.pyindex be779fa29857..50d270a9a265 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/gladly/tests/test_gladly.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/gladly/tests/test_gladly.py@@ -284,9 +284,9 @@ class TestGetEventRows:@pytest.mark.parametrize("watermark, resume_state, expected_first_start, expected_windows, expect_warning",[- (None, None, "2024-03-14T10:05:00.000Z", 24, False),- ("2024-03-10T00:00:00.000Z", None, "2024-03-14T10:05:00.000Z", 24, True),- ("not a timestamp", None, "2024-03-14T10:05:00.000Z", 24, True),+ (None, None, "2024-03-14T10:30:00.000Z", 24, False),+ ("2024-03-10T00:00:00.000Z", None, "2024-03-14T10:30:00.000Z", 24, True),+ ("not a timestamp", None, "2024-03-14T10:30:00.000Z", 24, True),("2024-03-15T06:00:00.000Z",GladlyResumeConfig(last_event_window_end="2024-03-15T08:00:00.000Z"),