Skip to content

Commit

Permalink
feat: remove exceptions to ignore from decide (#23177)
Browse files Browse the repository at this point in the history
  • Loading branch information
pauldambra authored and timgl committed Jun 27, 2024
1 parent d2055dd commit b89c5e2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 28 deletions.
1 change: 0 additions & 1 deletion posthog/api/decide.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ def get_decide(request: HttpRequest):
response["autocaptureExceptions"] = (
{
"endpoint": "/e/",
"errors_to_ignore": team.autocapture_exceptions_errors_to_ignore or [],
}
if team.autocapture_exceptions_opt_in
else False
Expand Down
30 changes: 3 additions & 27 deletions posthog/api/test/test_decide.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,31 +369,7 @@ def test_exception_autocapture_opt_in(self, *args):
response = self._post_decide().json()
self.assertEqual(
response["autocaptureExceptions"],
{"errors_to_ignore": [], "endpoint": "/e/"},
)

def test_exception_autocapture_errors_to_ignore(self, *args):
# :TRICKY: Test for regression around caching
response = self._post_decide().json()
self.assertEqual(response["autocaptureExceptions"], False)

self._update_team({"autocapture_exceptions_opt_in": True})
self._update_team(
{
"autocapture_exceptions_errors_to_ignore": [
"ResizeObserver loop limit exceeded",
".* bot .*",
]
}
)

response = self._post_decide().json()
self.assertEqual(
response["autocaptureExceptions"],
{
"errors_to_ignore": ["ResizeObserver loop limit exceeded", ".* bot .*"],
"endpoint": "/e/",
},
{"endpoint": "/e/"},
)

def test_user_session_recording_opt_in_wildcard_domain(self, *args):
Expand Down Expand Up @@ -2719,7 +2695,7 @@ def test_decide_doesnt_error_out_when_database_is_down(self, *args):
self.assertEqual(response["featureFlags"], {})
self.assertEqual(
response["autocaptureExceptions"],
{"errors_to_ignore": [], "endpoint": "/e/"},
{"endpoint": "/e/"},
)

# now database is down
Expand All @@ -2743,7 +2719,7 @@ def test_decide_doesnt_error_out_when_database_is_down(self, *args):
self.assertEqual(response["capturePerformance"], True)
self.assertEqual(
response["autocaptureExceptions"],
{"errors_to_ignore": [], "endpoint": "/e/"},
{"endpoint": "/e/"},
)
self.assertEqual(response["featureFlags"], {})

Expand Down

0 comments on commit b89c5e2

Please sign in to comment.