@@ -50,7 +50,9 @@ def test_ai_autofix_get_endpoint_with_autofix(
5050 assert "profile" not in response .data ["autofix" ]["request" ]
5151 assert "issue_summary" not in response .data ["autofix" ]["request" ]
5252
53- mock_get_autofix_state .assert_called_once_with (group_id = group .id , check_repo_access = True )
53+ mock_get_autofix_state .assert_called_once_with (
54+ group_id = group .id , check_repo_access = True , is_user_fetching = False
55+ )
5456
5557 @patch ("sentry.api.endpoints.group_ai_autofix.get_autofix_state" )
5658 def test_ai_autofix_get_endpoint_without_autofix (
@@ -65,7 +67,9 @@ def test_ai_autofix_get_endpoint_without_autofix(
6567 assert response .status_code == 200
6668 assert response .data ["autofix" ] is None
6769
68- mock_get_autofix_state .assert_called_once_with (group_id = group .id , check_repo_access = True )
70+ mock_get_autofix_state .assert_called_once_with (
71+ group_id = group .id , check_repo_access = True , is_user_fetching = False
72+ )
6973
7074 @patch ("sentry.api.endpoints.group_ai_autofix.get_autofix_state" )
7175 @patch ("sentry.api.endpoints.group_ai_autofix.get_sorted_code_mapping_configs" )
@@ -650,7 +654,7 @@ def test_ai_autofix_get_endpoint_cache_miss(
650654 # Verify cache behavior - cache miss should trigger repo access check
651655 mock_cache .get .assert_called_once_with (f"autofix_access_check:{ self .group .id } " )
652656 mock_get_autofix_state .assert_called_once_with (
653- group_id = self .group .id , check_repo_access = True
657+ group_id = self .group .id , check_repo_access = True , is_user_fetching = False
654658 )
655659
656660 # Verify the cache was set with a 60-second timeout
@@ -681,7 +685,7 @@ def test_ai_autofix_get_endpoint_cache_hit(
681685 # Verify cache behavior - cache hit should skip repo access check
682686 mock_cache .get .assert_called_once_with (f"autofix_access_check:{ self .group .id } " )
683687 mock_get_autofix_state .assert_called_once_with (
684- group_id = self .group .id , check_repo_access = False
688+ group_id = self .group .id , check_repo_access = False , is_user_fetching = False
685689 )
686690
687691 # Verify the cache was not set again
@@ -713,7 +717,9 @@ def test_ai_autofix_get_endpoint_polling_behavior(
713717
714718 # Verify first request behavior
715719 mock_cache .get .assert_called_once_with (f"autofix_access_check:{ group .id } " )
716- mock_get_autofix_state .assert_called_once_with (group_id = group .id , check_repo_access = True )
720+ mock_get_autofix_state .assert_called_once_with (
721+ group_id = group .id , check_repo_access = True , is_user_fetching = False
722+ )
717723 mock_cache .set .assert_called_once_with (f"autofix_access_check:{ group .id } " , True , timeout = 60 )
718724
719725 # Reset mocks for second request
@@ -728,7 +734,9 @@ def test_ai_autofix_get_endpoint_polling_behavior(
728734
729735 # Verify second request behavior
730736 mock_cache .get .assert_called_once_with (f"autofix_access_check:{ group .id } " )
731- mock_get_autofix_state .assert_called_once_with (group_id = group .id , check_repo_access = False )
737+ mock_get_autofix_state .assert_called_once_with (
738+ group_id = group .id , check_repo_access = False , is_user_fetching = False
739+ )
732740 mock_cache .set .assert_not_called ()
733741
734742 # Reset mocks for third request
@@ -743,5 +751,7 @@ def test_ai_autofix_get_endpoint_polling_behavior(
743751
744752 # Verify third request behavior - should be like the first request
745753 mock_cache .get .assert_called_once_with (f"autofix_access_check:{ group .id } " )
746- mock_get_autofix_state .assert_called_once_with (group_id = group .id , check_repo_access = True )
754+ mock_get_autofix_state .assert_called_once_with (
755+ group_id = group .id , check_repo_access = True , is_user_fetching = False
756+ )
747757 mock_cache .set .assert_called_once_with (f"autofix_access_check:{ group .id } " , True , timeout = 60 )
0 commit comments