1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
|
From 67ee6693075f1d65ecaf0a9d76493fbbc84f8022 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Matt=C3=A9o=20Rossillol=E2=80=91=E2=80=91Laruelle?=
<beatussum@protonmail.com>
Date: Sat, 4 Oct 2025 17:01:29 +0200
Subject: [PATCH] remove anonymous bug report
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This feature depends on dev-python/sentry-sdk, a package that was removed from
the main tree due to its difficulty in being packaged correctly.
Signed-off-by: Mattéo Rossillol‑‑Laruelle <beatussum@protonmail.com>
---
proton/vpn/app/gtk/controller.py | 13 -------
proton/vpn/app/gtk/utils/exception_handler.py | 4 --
.../menu/settings/general_settings.py | 14 -------
tests/unit/utils/test_exception_handler.py | 37 +------------------
4 files changed, 1 insertion(+), 67 deletions(-)
diff --git a/proton/vpn/app/gtk/controller.py b/proton/vpn/app/gtk/controller.py
index 450db35..2a51c6a 100644
--- a/proton/vpn/app/gtk/controller.py
+++ b/proton/vpn/app/gtk/controller.py
@@ -499,19 +499,6 @@ class Controller: # pylint: disable=too-many-public-methods, too-many-instance-
key=lambda protocol: protocol.cls.ui_protocol
)
- def send_error_to_proton(
- self,
- error: Union[
- BaseException,
- tuple[
- Optional[Type[BaseException]],
- Optional[BaseException],
- Optional[TracebackType]]
- ]
- ):
- """Sends the error to Sentry."""
- self._api.usage_reporting.report_error(error)
-
def run_subprocess(self, commands: list, shell: bool = False) -> Future:
"""Run asynchronously subprocess command so it does not block UI."""
return self.executor.submit(
diff --git a/proton/vpn/app/gtk/utils/exception_handler.py b/proton/vpn/app/gtk/utils/exception_handler.py
index 55bf536..18ae4c6 100644
--- a/proton/vpn/app/gtk/utils/exception_handler.py
+++ b/proton/vpn/app/gtk/utils/exception_handler.py
@@ -260,10 +260,6 @@ class ExceptionHandler:
exc_info=(exc_type, exc_value, exc_traceback)
)
- if self.controller:
- self.controller.send_error_to_proton(
- (exc_type, exc_value, exc_traceback))
-
def __enter__(self):
self.enable()
return self
diff --git a/proton/vpn/app/gtk/widgets/headerbar/menu/settings/general_settings.py b/proton/vpn/app/gtk/widgets/headerbar/menu/settings/general_settings.py
index f690767..39ee722 100644
--- a/proton/vpn/app/gtk/widgets/headerbar/menu/settings/general_settings.py
+++ b/proton/vpn/app/gtk/widgets/headerbar/menu/settings/general_settings.py
@@ -87,10 +87,6 @@ class GeneralSettings(BaseCategoryContainer): # pylint: disable=too-many-instan
START_APP_MINIMIZED_LABEL = "Start app minimized"
START_APP_MINIMIZED_DESCRIPTION = "When enabled, the app starts minimized "\
"to the tray."
- ANONYMOUS_CRASH_REPORTS_LABEL = "Share anonymous crash reports"
- ANONYMOUS_CRASH_REPORTS_DESCRIPTION = "Crash reports help us fix bugs, detect firewalls, "\
- "and avoid VPN blocks.\n\nThese statistics do not contain your IP address, and they "\
- "cannot be used to identify you. We'll never share them with third parties."
def __init__(
self, controller: Controller,
@@ -109,7 +105,6 @@ class GeneralSettings(BaseCategoryContainer): # pylint: disable=too-many-instan
self.build_start_app_minimized()
self.build_tray_pinned_servers()
- self.build_anonymous_crash_reports()
self.build_beta_upgrade()
def build_connect_at_app_startup(self):
@@ -144,15 +139,6 @@ class GeneralSettings(BaseCategoryContainer): # pylint: disable=too-many-instan
controller=self._controller, tray_indicator=self._tray_indicator
), False, False, 0)
- def build_anonymous_crash_reports(self):
- """Builds and adds the `anonymous_crash_reports` setting to the widget."""
- self.pack_start(ToggleWidget(
- controller=self._controller,
- title=self.ANONYMOUS_CRASH_REPORTS_LABEL,
- description=self.ANONYMOUS_CRASH_REPORTS_DESCRIPTION,
- setting_name="settings.anonymous_crash_reports"
- ), False, False, 0)
-
def build_beta_upgrade(self):
"""Builds and adds the `Early Access` setting to the widget."""
early_access = EarlyAccessWidget(self._controller)
diff --git a/tests/unit/utils/test_exception_handler.py b/tests/unit/utils/test_exception_handler.py
index d925d86..74d35ec 100644
--- a/tests/unit/utils/test_exception_handler.py
+++ b/tests/unit/utils/test_exception_handler.py
@@ -150,41 +150,6 @@ def test_handle_exceptions_that_should_be_raised_again(exception_type):
exc_traceback=None
)
-@pytest.mark.parametrize(
- "exception,error_title,error_message", [
- (Exception("Unexpected error"), ExceptionHandler.GENERIC_ERROR_TITLE, ExceptionHandler.GENERIC_ERROR_MESSAGE),
- ]
-)
-def test_handle_exceptions_reporting_remotely(
- exception, error_title, error_message
-):
- send_error = SimpleNamespace(invoked=False)
-
- def send_error_to_proton(error):
- exc_type, exc_value, exc_traceback = error
-
- # Make sure we're sent the correct information
- assert exc_type is Exception
- assert isinstance(exc_value, Exception)
-
- # Make sure we were actually invoked
- send_error.invoked = True
-
- controller = Mock()
- controller.send_error_to_proton = send_error_to_proton
-
- main_widget_mock = Mock()
- exception_handler = ExceptionHandler(main_widget=main_widget_mock,
- controller=controller)
-
- exception_handler.handle_exception(
- exc_type=type(exception),
- exc_value=exception,
- exc_traceback=None
- )
-
- assert send_error.invoked, "send_error_to_proton not invoked"
-
def test_handle_exception_logs_user_out_and_shows_missing_scope_dialog_on_proton_api_missing_scope_error():
main_widget_mock = Mock(MainWidget)
exception_handler = ExceptionHandler(main_widget=main_widget_mock)
@@ -214,4 +179,4 @@ def test_handle_exception_logs_user_out_and_shows_missing_scope_dialog_on_proton
)
main_widget_mock.logout.assert_called_once()
- main_widget_mock.notifications.show_error_dialog.assert_called_once()
\ No newline at end of file
+ main_widget_mock.notifications.show_error_dialog.assert_called_once()
--
2.49.1
|