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.

chore(replay-vision): drop retired tables, columns and deprecated patches (#113632)

Tue Haulund870dc307fa3c
diff --git a/products/replay_vision/backend/migrations/0116_drop_replayscannerpromptsuggestion_table.py b/products/replay_vision/backend/migrations/0116_drop_replayscannerpromptsuggestion_table.py
new file mode 100644
index 000000000000..148dcfb6bf99
--- /dev/null
+++ b/products/replay_vision/backend/migrations/0116_drop_replayscannerpromptsuggestion_table.py
@@ -0,0 +1,14 @@
+from django.db import migrations
+
+from posthog.migration_helpers import SafeDropTable
+
+
+class Migration(migrations.Migration):
+ # 0106 removed the model from state and dropped its scanner foreign key.
+ dependencies = [
+ ("replay_vision", "0115_untrack_media_clip_fields"),
+ ]
+
+ operations = [
+ SafeDropTable("replay_vision_replayscannerpromptsuggestion"),
+ ]
diff --git a/products/replay_vision/backend/migrations/0117_drop_replayscanner_feedback_themes.py b/products/replay_vision/backend/migrations/0117_drop_replayscanner_feedback_themes.py
new file mode 100644
index 000000000000..48b3a7a889d9
--- /dev/null
+++ b/products/replay_vision/backend/migrations/0117_drop_replayscanner_feedback_themes.py
@@ -0,0 +1,20 @@
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+ # 0106 untracked the column. Each table drops in its own migration, so one table's lock never waits on the other's.
+ dependencies = [
+ ("replay_vision", "0116_drop_replayscannerpromptsuggestion_table"),
+ ]
+
+ operations = [
+ migrations.SeparateDatabaseAndState(
+ state_operations=[],
+ database_operations=[
+ migrations.RunSQL(
+ sql='ALTER TABLE "replay_vision_replayscanner" DROP COLUMN IF EXISTS "feedback_themes"',
+ reverse_sql='ALTER TABLE "replay_vision_replayscanner" ADD COLUMN IF NOT EXISTS "feedback_themes" jsonb NULL',
+ ),
+ ],
+ ),
+ ]
diff --git a/products/replay_vision/backend/migrations/0118_drop_replayobservationmedia_clip_columns.py b/products/replay_vision/backend/migrations/0118_drop_replayobservationmedia_clip_columns.py
new file mode 100644
index 000000000000..cbf2dcbee8c5
--- /dev/null
+++ b/products/replay_vision/backend/migrations/0118_drop_replayobservationmedia_clip_columns.py
@@ -0,0 +1,30 @@
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+ # 0115 untracked the clip columns. One ALTER TABLE takes the table lock once.
+ dependencies = [
+ ("replay_vision", "0117_drop_replayscanner_feedback_themes"),
+ ]
+
+ operations = [
+ migrations.SeparateDatabaseAndState(
+ state_operations=[],
+ database_operations=[
+ migrations.RunSQL(
+ sql=(
+ 'ALTER TABLE "replay_vision_replayobservationmedia" '
+ 'DROP COLUMN IF EXISTS "description", '
+ 'DROP COLUMN IF EXISTS "video_end_ms", '
+ 'DROP COLUMN IF EXISTS "rec_end_ms"'
+ ),
+ reverse_sql=(
+ 'ALTER TABLE "replay_vision_replayobservationmedia" '
+ 'ADD COLUMN IF NOT EXISTS "description" text NULL, '
+ 'ADD COLUMN IF NOT EXISTS "video_end_ms" integer NULL, '
+ 'ADD COLUMN IF NOT EXISTS "rec_end_ms" integer NULL'
+ ),
+ ),
+ ],
+ ),
+ ]
diff --git a/products/replay_vision/backend/migrations/max_migration.txt b/products/replay_vision/backend/migrations/max_migration.txt
index cc1aab9ff46d..19a8d6f6730f 100644
--- a/products/replay_vision/backend/migrations/max_migration.txt
+++ b/products/replay_vision/backend/migrations/max_migration.txt
@@ -1 +1 @@
-0115_untrack_media_clip_fields
+0118_drop_replayobservationmedia_clip_columns
diff --git a/products/replay_vision/backend/temporal/media_workflow.py b/products/replay_vision/backend/temporal/media_workflow.py
index bcd91501b205..653974506455 100644
--- a/products/replay_vision/backend/temporal/media_workflow.py
+++ b/products/replay_vision/backend/temporal/media_workflow.py
@@ -39,7 +39,6 @@ class ObservationMediaWorkflow(PostHogWorkflow):
@wf.run
async def run(self, inputs: ObservationMediaInputs) -> None:
- wf.deprecate_patch("replay-vision-media-batch-2026-10")
prepared: PrepareObservationMediaOutput = await wf.execute_activity(
prepare_observation_media_activity,
inputs,
diff --git a/products/replay_vision/backend/temporal/reconciler.py b/products/replay_vision/backend/temporal/reconciler.py
index d78052061e09..18b2f45f3c11 100644
--- a/products/replay_vision/backend/temporal/reconciler.py
+++ b/products/replay_vision/backend/temporal/reconciler.py
@@ -62,7 +62,6 @@ class ReconcileScannerSchedulesWorkflow(PostHogWorkflow):
@workflow.run
async def run(self, inputs: ReconcileScannerSchedulesInputs) -> ReconcileScannerSchedulesResult:
- workflow.deprecate_patch("sync-schedules-before-reapers-2026-08")
# Schedule sync goes first because it is the only phase a user feels: an enabled scanner
# that never gets a sweep schedule silently never scans. The reapers only settle rows that
# are already wrong, so a skipped pass costs one tick. The reapers' combined start-to-close
@@ -85,13 +84,11 @@ class ReconcileScannerSchedulesWorkflow(PostHogWorkflow):
except Exception:
workflow.logger.exception("replay_vision.reap_orphaned_observations_failed")
- workflow.deprecate_patch("reap-childless-inline-scanners-2026-08")
try:
await self._run_reaper(reap_childless_inline_scanners_activity)
except Exception:
workflow.logger.exception("replay_vision.reap_childless_inline_scanners_failed")
- workflow.deprecate_patch("reap-backfill-schedules-2026-08")
try:
# A full schedule listing outlives the short reaper attempt, so this one keeps a long
# attempt and leans on heartbeats to detect a dead worker.
@@ -104,7 +101,6 @@ class ReconcileScannerSchedulesWorkflow(PostHogWorkflow):
except Exception:
workflow.logger.exception("replay_vision.reap_backfill_schedules_failed")
- workflow.deprecate_patch("start-launched-scanners-2026-10")
try:
await self._run_reaper(start_launched_scanners_activity)
except Exception:
diff --git a/products/replay_vision/backend/temporal/sweep_workflow.py b/products/replay_vision/backend/temporal/sweep_workflow.py
index 1ca72f27ea0b..b07ff79c1540 100644
--- a/products/replay_vision/backend/temporal/sweep_workflow.py
+++ b/products/replay_vision/backend/temporal/sweep_workflow.py
@@ -57,8 +57,6 @@ class SweepScannerWorkflow(PostHogWorkflow):
async def run(self, inputs: SweepScannerInputs) -> None:
# A capped scanner scans no sessions this tick. Fails open because admissions stay gated at the
# persistence boundary.
- wf.deprecate_patch("drop-prompt-suggestion-refresh-2026-10")
- wf.deprecate_patch("replay-vision-scanner-credit-limit")
try:
budget = await wf.execute_activity(
check_scanner_budget_activity,
@@ -77,7 +75,6 @@ class SweepScannerWorkflow(PostHogWorkflow):
# min of the two headrooms. Skip entirely when saturated. Keeps any single tenant from flooding the
# shared rasterizer + provider concurrency. A DB error fails the count (single attempt), so the sweep
# skips this tick rather than dispatching against an unknown load; the next tick retries in 5 minutes.
- wf.deprecate_patch("replay-vision-team-in-flight-caps")
in_flight = await wf.execute_activity(
count_in_flight_by_team_activity,
CountInFlightAppliesInputs(scanner_id=inputs.scanner_id, team_id=inputs.team_id),
@@ -85,7 +82,6 @@ class SweepScannerWorkflow(PostHogWorkflow):
retry_policy=common.RetryPolicy(maximum_attempts=1),
)
scanner_in_flight, team_in_flight = in_flight.scanner, in_flight.team
- wf.deprecate_patch("replay-vision-on-demand-reserved-headroom")
headroom = in_flight_headroom(scanner_in_flight, team_in_flight)
if headroom <= 0:
# At a cap — drain before fetching more. Don't advance the watermark; resume next tick.
diff --git a/products/replay_vision/backend/temporal/vision_alerts/workflow.py b/products/replay_vision/backend/temporal/vision_alerts/workflow.py
index 5b544b32cfef..8ff7cd01bcce 100644
--- a/products/replay_vision/backend/temporal/vision_alerts/workflow.py
+++ b/products/replay_vision/backend/temporal/vision_alerts/workflow.py
@@ -81,7 +81,6 @@ class VisionAlertCheckWorkflow(PostHogWorkflow):
output.alerts_resolved += result.alerts_resolved
output.alerts_errored += result.alerts_errored
- workflow.deprecate_patch("vision-alert-match-drain-2026-08")
try:
await workflow.execute_activity(
drain_vision_alert_matches_activity,
diff --git a/products/replay_vision/backend/temporal/workflow.py b/products/replay_vision/backend/temporal/workflow.py
index 466b966af704..3a8eccc596ac 100644
--- a/products/replay_vision/backend/temporal/workflow.py
+++ b/products/replay_vision/backend/temporal/workflow.py
@@ -377,7 +377,6 @@ class ApplyScannerWorkflow(PostHogWorkflow):
# 30s once truncated the tail on a slow facade, so give it 2 minutes; retries are safe
# because each finding carries a deterministic idempotency key.
try:
- wf.deprecate_patch("replay-vision-emitted-signal-summaries")
signal_summaries = await wf.execute_activity(
emit_observation_signal_summaries_activity,
emit_inputs,
@@ -453,7 +452,6 @@ class ApplyScannerWorkflow(PostHogWorkflow):
# Gating on scanner_type is deterministic: it comes from the create activity's recorded output.
resolve_task = None
if scanner_type == ScannerType.EXPERIMENT:
- wf.deprecate_patch("replay-vision-experiment-variant-2026-09")
# Rides alongside the fetch, so attribution costs no wall-clock. An unexposed session
# raises IneligibleSessionError here, before any model call and at no credit cost.
resolve_task = wf.execute_activity(
@@ -489,7 +487,6 @@ class ApplyScannerWorkflow(PostHogWorkflow):
schedule_to_close_timeout=STATE_ACTIVITY_SCHEDULE_TO_CLOSE,
retry_policy=_ENSURE_ASSET_RETRY,
)
- wf.deprecate_patch("replay-vision-session-network-2026-09")
# Rides alongside the other two so the extra recording-block read costs no wall-clock.
network_task = wf.execute_activity(
fetch_session_network_activity,
@@ -536,7 +533,6 @@ class ApplyScannerWorkflow(PostHogWorkflow):
# it a failure would point the user at support over a recording that can never produce a video.
raise IneligibleSessionError(_root_cause_message(e), kind=IneligibleSessionKind.NO_SNAPSHOTS) from e
if _failure_type(e) == _RASTERIZER_TOO_LARGE_TYPE:
- wf.deprecate_patch("replay-vision-too-large-ineligible-2026-08")
# Gate as ineligible, not failed, so the user reads "too large" instead of a "known issue" retry prompt.
raise IneligibleSessionError(_root_cause_message(e), kind=IneligibleSessionKind.TOO_LARGE) from e
rasterizer_type = _failure_type(e)
@@ -563,7 +559,6 @@ class ApplyScannerWorkflow(PostHogWorkflow):
# Direct cause only: a nested activity timeout inside the child already bumped the
# counter there, and matching it here would double-count one run.
if isinstance(e, ChildWorkflowError) and isinstance(e.cause, TemporalTimeoutError):
- wf.deprecate_patch("bump-stuck-on-rasterize-timeout-2026-08")
# The single-attempt execution_timeout terminates the child before its own final-attempt
# bump can run, so a render that rode out the whole budget would never reach the
# quarantine threshold. Bump from here instead; the child's own bump covers every
@@ -588,7 +583,6 @@ class ApplyScannerWorkflow(PostHogWorkflow):
call_output: ScannerCallOutput,
) -> None:
"""Render the observation's thumbnail. Fail-soft: a missing poster must never fail a paid-for scan."""
- wf.deprecate_patch("replay-vision-media-2026-09")
try:
# Started, not awaited: the poster is delivery, and the scan has no reason to hold a workflow
# slot open while one frame is cut. ABANDON keeps the child alive past the parent's close.
diff --git a/products/replay_vision/backend/tests/test_reconciler.py b/products/replay_vision/backend/tests/test_reconciler.py
index 8c959b561861..ce6ab53b2df4 100644
--- a/products/replay_vision/backend/tests/test_reconciler.py
+++ b/products/replay_vision/backend/tests/test_reconciler.py
@@ -278,7 +278,6 @@ async def _run_reconcile(mocks: _ReconcileMocks):
with (
patch("temporalio.workflow.execute_activity", side_effect=mocks.execute_activity),
patch("temporalio.workflow.logger", fake_logger),
- patch("temporalio.workflow.deprecate_patch"),
):
return await ReconcileScannerSchedulesWorkflow().run(ReconcileScannerSchedulesInputs())
diff --git a/products/replay_vision/backend/tests/test_sweep.py b/products/replay_vision/backend/tests/test_sweep.py
index eae6a9c3b70f..57a65f15b7da 100644
--- a/products/replay_vision/backend/tests/test_sweep.py
+++ b/products/replay_vision/backend/tests/test_sweep.py
@@ -1505,7 +1505,6 @@ async def _run_sweep(mocks: _SweepMocks, inputs: SweepScannerInputs | None = Non
patch("temporalio.workflow.execute_activity", side_effect=mocks.execute_activity),
patch("temporalio.workflow.start_child_workflow", side_effect=mocks.start_child_workflow),
patch("temporalio.workflow.logger", fake_logger),
- patch("temporalio.workflow.deprecate_patch"),
patch("temporalio.workflow.unsafe.is_replaying", return_value=False),
):
await SweepScannerWorkflow().run(inputs or _sweep_inputs())
diff --git a/products/replay_vision/backend/tests/test_temporal.py b/products/replay_vision/backend/tests/test_temporal.py
index 35c1e4e5494b..afa9b54ee912 100644
--- a/products/replay_vision/backend/tests/test_temporal.py
+++ b/products/replay_vision/backend/tests/test_temporal.py
@@ -2729,7 +2729,6 @@ async def _run_workflow(
patch("temporalio.workflow.execute_child_workflow", side_effect=mocks.execute_child_workflow),
# `wf.logger` requires a real workflow event loop, which this direct-call harness skips.
patch("temporalio.workflow.logger"),
- patch("temporalio.workflow.deprecate_patch"),
):
await ApplyScannerWorkflow().run(inputs)