: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(cymbal): only mark used symbol sets on load (#59419)
Hugues Pouillot72087135e1c2
diff --git a/products/error_tracking/backend/api/symbol_sets.py b/products/error_tracking/backend/api/symbol_sets.pyindex 8aeb66efec49..c1dd49866958 100644--- a/products/error_tracking/backend/api/symbol_sets.py+++ b/products/error_tracking/backend/api/symbol_sets.py@@ -3,7 +3,6 @@ from dataclasses import dataclassfrom django.conf import settingsfrom django.db import transaction-from django.utils import timezoneimport structlogimport posthoganalytics@@ -417,7 +416,6 @@ class ErrorTrackingSymbolSetViewSet(TeamAndOrgViewSetMixin, viewsets.ModelViewSeif not symbol_set.content_hash:symbol_set.content_hash = content_hash- symbol_set.last_used = timezone.now()symbol_set.save()return Response({"success": True}, status=status.HTTP_200_OK)@@ -524,8 +522,7 @@ class ErrorTrackingSymbolSetViewSet(TeamAndOrgViewSetMixin, viewsets.ModelViewSecontent_hash = content_hashes[str(symbol_set.id)]symbol_set.content_hash = content_hash- symbol_set.last_used = timezone.now()- ErrorTrackingSymbolSet.objects.bulk_update(symbol_sets, ["content_hash", "last_used"])+ ErrorTrackingSymbolSet.objects.bulk_update(symbol_sets, ["content_hash"])except Exception as e:for id in content_hashes.keys():# Try to clean up the symbol sets preemptively if the upload fails@@ -580,7 +577,6 @@ def create_symbol_set(raise ValidationError(f"Symbol set has already been uploaded for a different release")symbol_set.storage_ptr = storage_ptrsymbol_set.content_hash = content_hash- symbol_set.last_used = timezone.now()symbol_set.save()except ErrorTrackingSymbolSet.DoesNotExist:@@ -590,7 +586,6 @@ def create_symbol_set(release=release,storage_ptr=storage_ptr,content_hash=content_hash,- last_used=timezone.now(),)# Delete any existing frames associated with this symbol set@@ -658,7 +653,6 @@ def bulk_create_symbol_sets(ref=chunk_id,storage_ptr=storage_ptr,release_id=new_symbol_set_map[chunk_id].release_id,- last_used=timezone.now(),)symbol_sets_to_be_created.append(to_create)diff --git a/products/error_tracking/backend/api/test/test_error_tracking_api.py b/products/error_tracking/backend/api/test/test_error_tracking_api.pyindex b8bfcc063670..d338a0c28e8e 100644--- a/products/error_tracking/backend/api/test/test_error_tracking_api.py+++ b/products/error_tracking/backend/api/test/test_error_tracking_api.py@@ -232,6 +232,7 @@ class TestErrorTracking(APIBaseTest):symbol_set = ErrorTrackingSymbolSet.objects.get(id=response_json["symbol_set_id"])assert symbol_set.content_hash is None+ assert symbol_set.last_used is Nonedef test_finish_upload_fails_if_file_not_found(self):symbol_set = ErrorTrackingSymbolSet.objects.create(@@ -277,6 +278,7 @@ class TestErrorTracking(APIBaseTest):assert response.status_code == status.HTTP_200_OKassert symbol_set.content_hash == "this_is_a_content_hash"+ assert symbol_set.last_used is Nonedef test_can_bulk_delete_symbol_sets(self) -> None:ss1 = ErrorTrackingSymbolSet.objects.create(ref="source_1", team=self.team, storage_ptr=None)@@ -590,6 +592,7 @@ class TestErrorTracking(APIBaseTest):assert str(symbol_set.id) == symbol_set_upload_response["symbol_set_id"]assert symbol_set_upload_response["presigned_url"]["fields"]["key"] == symbol_set.storage_ptr+ assert symbol_set.last_used is Nonedef test_bulk_start_upload_skips_uploaded_symbol_sets(self) -> None:release = ErrorTrackingRelease.objects.create(@@ -640,6 +643,7 @@ class TestErrorTracking(APIBaseTest):new_symbol_set = ErrorTrackingSymbolSet.objects.get(ref=new_chunk_id)assert new_symbol_set.release_id == release.id+ assert new_symbol_set.last_used is Noneassert id_map[str(new_chunk_id)]["symbol_set_id"] == str(new_symbol_set.id)@parameterized.expand(