From ab322ae703024026e80dd4d9857dd95705184a80 Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Mon, 15 Jan 2024 15:22:25 +0100 Subject: [PATCH] Always send user name for Sentry if available CURA-11482 --- plugins/CuraEngineBackend/Cura.proto | 1 + plugins/CuraEngineBackend/CuraEngineBackend.py | 6 ------ plugins/CuraEngineBackend/StartSliceJob.py | 1 + 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/plugins/CuraEngineBackend/Cura.proto b/plugins/CuraEngineBackend/Cura.proto index b03298f695..238829ba64 100644 --- a/plugins/CuraEngineBackend/Cura.proto +++ b/plugins/CuraEngineBackend/Cura.proto @@ -36,6 +36,7 @@ message Slice string sentry_id = 6; // The anonymized Sentry user id that requested the slice string cura_version = 7; // The version of Cura that requested the slice optional string project_name = 8; // The name of the project that requested the slice + optional string user_name = 9; // The Digital Factory account name of the user that requested the slice } message Extruder diff --git a/plugins/CuraEngineBackend/CuraEngineBackend.py b/plugins/CuraEngineBackend/CuraEngineBackend.py index a22d6b5306..0c4003fadc 100755 --- a/plugins/CuraEngineBackend/CuraEngineBackend.py +++ b/plugins/CuraEngineBackend/CuraEngineBackend.py @@ -199,7 +199,6 @@ class CuraEngineBackend(QObject, Backend): # Ensure that the initial value for send_engine_crash is handled correctly. application.callLater(self._onPreferencesChanged, "info/send_engine_crash") - application.callLater(self._onPreferencesChanged, "info/anonymous_engine_crash_report") def startPlugins(self) -> None: """ @@ -1104,11 +1103,6 @@ class CuraEngineBackend(QObject, Backend): self._change_timer.start() elif preference == "info/send_engine_crash": os.environ["USE_SENTRY"] = "1" if CuraApplication.getInstance().getPreferences().getValue("info/send_engine_crash") else "0" - elif preference == "info/anonymous_engine_crash_report": - if not CuraApplication.getInstance().getPreferences().getValue("info/anonymous_engine_crash_report"): - account = CuraApplication.getInstance().getCuraAPI().account - if account and account.isLoggedIn: - os.environ["CURAENGINE_SENTRY_USER"] = account.userName def tickle(self) -> None: """Tickle the backend so in case of auto slicing, it starts the timer.""" diff --git a/plugins/CuraEngineBackend/StartSliceJob.py b/plugins/CuraEngineBackend/StartSliceJob.py index 8826d2e1f6..633352d616 100644 --- a/plugins/CuraEngineBackend/StartSliceJob.py +++ b/plugins/CuraEngineBackend/StartSliceJob.py @@ -344,6 +344,7 @@ class StartSliceJob(Job): account = CuraApplication.getInstance().getCuraAPI().account if account and account.isLoggedIn and not CuraApplication.getInstance().getPreferences().getValue("info/anonymous_engine_crash_report"): self._slice_message.project_name = CuraApplication.getInstance().getPrintInformation().baseName + self._slice_message.user_name = account.userName # Build messages for extruder stacks for extruder_stack in global_stack.extruderList: